Android Question Activity_KeyPress crashing on Note 3

johnl

Member
Licensed User
Longtime User
Hi,

I've been using this code to detect the back button being pressed, confirming with the user that they want to go back, and then either ending the activity or not depending on the response.

It works fine on my phone (galaxy note 2), but not my clients' galaxy note 3 - it crashes every time. Does anybody know why? I don't have access to a note 3 to test it on.

Thanks

B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean

    If KeyCode = KeyCodes.KEYCODE_BACK Then   
        If MiscFunctions.DoYouReallyWantToQuit = -1 Then
            Activity.Finish
        Else
            Return True
        End If
    End If

End Sub
 

johnl

Member
Licensed User
Longtime User
Thanks guys,

I've just upgraded to the latest version, but the app was produced using an earlier one. So if I re-compile it with the latest version it should work?

Fair comment about return false too.
 
Upvote 0
Top