When i Press the volume Button my app Chrashes with the Posted error (fatal signal)
my code is:
If KeyCode = KeyCodes.KEYCODE_VOLUME_DOWN Then
Dim PhoneVol As Phone
Dim temp As Int
temp = PhoneVol .GetVolume(PhoneVol .VOLUME_MUSIC)
If temp > 0 Then
temp = temp - 1
PhoneVol .SetVolume(PhoneVol .VOLUME_MUSIC, temp, True)
End If
End If
If KeyCode = KeyCodes.KEYCODE_VOLUME_UP Then
temp = PhoneVol .GetVolume(PhoneVol .VOLUME_MUSIC)
If temp < PhoneVol .GetMaxVolume(PhoneVol .VOLUME_MUSIC) Then
temp = temp + 1
PhoneVol .SetVolume(PhoneVol .VOLUME_MUSIC, temp, True)
End If
End If
Erel Posted a Workaround, but unfortunately it doesn´t work for me
Erels workaround covers only when the user closes the app with the backkey
--> http://www.b4x.com/android/forum/threads/android-4-3-pb-with-closing-the-app.31328/page-2
My other Problem is that i Use the Back key not only to close my application
For example i Set some Views/controls to Visible false when i press the backkey (when the views are visible true --> back key --> views visible false)
my code is:
If KeyCode = KeyCodes.KEYCODE_VOLUME_DOWN Then
Dim PhoneVol As Phone
Dim temp As Int
temp = PhoneVol .GetVolume(PhoneVol .VOLUME_MUSIC)
If temp > 0 Then
temp = temp - 1
PhoneVol .SetVolume(PhoneVol .VOLUME_MUSIC, temp, True)
End If
End If
If KeyCode = KeyCodes.KEYCODE_VOLUME_UP Then
temp = PhoneVol .GetVolume(PhoneVol .VOLUME_MUSIC)
If temp < PhoneVol .GetMaxVolume(PhoneVol .VOLUME_MUSIC) Then
temp = temp + 1
PhoneVol .SetVolume(PhoneVol .VOLUME_MUSIC, temp, True)
End If
End If
Erel Posted a Workaround, but unfortunately it doesn´t work for me
Erels workaround covers only when the user closes the app with the backkey
--> http://www.b4x.com/android/forum/threads/android-4-3-pb-with-closing-the-app.31328/page-2
My other Problem is that i Use the Back key not only to close my application
For example i Set some Views/controls to Visible false when i press the backkey (when the views are visible true --> back key --> views visible false)