Android Question Problem with phone timeout

zetadan

Member
Licensed User
Longtime User
I have developed an app that works fine on my phone except for one problem. The issue occurs, when the app is running but is just in the state of waiting for an action (button press etc.). If the phone times out at that point and needs to be unlocked, my app just has a blank screen. The only choice is to end the app. Could this be related to the app re-running activity_create or something else? I think I have taken care of this.

I think this is probably simple but I can't figure out what is happening. Anyone have any ideas?
 

zetadan

Member
Licensed User
Longtime User
Thanks Erel,

Before I get into showing the code in question(it is pretty extensive and somewhat messy), I will reread the tutorial. I use the following code to capture the back button but that message does not show up.
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
    If KeyCode = KeyCodes.KEYCODE_BACK Then
        If Msgbox2("Do you want to close?", "", "Yes", "Cancel", "No", Null) = DialogResponse.POSITIVE Then
            ' Return False
            ExitApplication 'App is exiting
        Else
            Return True
        End If
    End If
End Sub
 
Upvote 0
Top