I had the need to create a menu when it is required to exit App from the Back button of the device but also from the home button.
So I have to create something similar to closing the device.
Here is my new office.
SD_MenuClose
Author: Star-Dust
Version: 0.03
- MenuClose
- Functions:
- Class_Globals As String
- Initialize As String
Initializes the object. You can add parameters to this method if needed.
- ExitApplication2 As String
- IsInitialized As Boolean
Verifica se l'oggetto sia stato inizializzato.
View attachment 68505
use:
Code:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode=KeyCodes.KEYCODE_BACK Then
Dim MC As MenuClose
MC.Initialize
Return True
End If
Return False
End Sub