Android Question SD_MenuClose

Theera

Well-Known Member
Licensed User
Longtime User
Hi all,
I have studied SD_MenuClose. I have tried to apply my app. After I hit the system back button,it only hide the app(Not really close the app) My problem is occured after I run app again. so
I add Erel's CloseActivities Module ,it can close,but it is not waiting for selection the choice. How do I code?

B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
    If KeyCode=KeyCodes.KEYCODE_BACK Then
      
        CallSubDelayed2(Me,"CloseActivities",True)
    '    Return True
    End If
  
    Return False
End Sub

B4X:
Sub CloseActivities
    Dim jo As JavaObject
    jo.InitializeContext
    Dim MC As MenuClose
        MC.Initialize(Colors.ARGB(200,150,150,150),Colors.Blue)
    jo.RunMethod("finishAffinity", Null)
  
End Sub
]
 
Top