KeyCode

omoba

Active Member
Licensed User
Longtime User
Hi,

Pls what is wrong with my code/device (Motorola Photon)?

When I click the volume control the volume control also acts as the return key.

If KeyCode = KeyCodes.KEYCODE_BACK AND m =1 Then
Return False
Else
MP.Play
bd.Initialize(LoadBitmap(File.DirAssets, "bkg.jpg"))
Activity.Background = bd
m =1
Return True
End If

End Sub
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use [ code ] [ /code ] tags (without spaces) when posting code.

If I understand the question correctly then your code should be:
B4X:
If KeyCode = KeyCodes.KEYCODE_BACK Then
 If m =1 Then
  Return False
 Else
  MP.Play
  bd.Initialize(LoadBitmap(File.DirAssets, "bkg.jpg"))
  Activity.Background = bd
  m =1
  Return True
 End If
 Return False
End If
 
Upvote 0
Top