Sub Activity_Pause (UserClosed As Boolean)
If UserClosed Then
If Msgbox2("Speichern?","?","Ja","","Nein",Null)=DialogResponse.Positive Then
ToastMessageShow ("gespeichert",True)
End If
End If
End Sub
But of course this is not possible.
But wherre can I place such a question before closing an activity? I want the user to decide if he wants to save his changes or not.
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
' your code
' Return True ' uncomment this line if you want to consume the event
Else
' other code
End If
Return False