The best way to close my app

vampire

New Member
Hi everybody

I'm wondering how to close my app like any other professional app (when press C the app close it's self and does not appear in any task manager as active) .

Thanks .
 

mc73

Well-Known Member
Licensed User
Longtime User
I think you can use activity.finish in the activity_keypress sub, catching the 'Back' key.
 
Upvote 0

onumad

Member
Licensed User
Longtime User
I'm using
B4X:
Sub Activity_Pause (UserClosed As Boolean)
   If UserClosed Then
      Activity.Finish
   End If
End Sub
, you can force kill app with
B4X:
Sub Activity_Pause (UserClosed As Boolean)
   If UserClosed Then
      Activity.Finish
      ExitApplication
   End If
End Sub

Best explain by Erel in this post
 
Last edited:
Upvote 0

DTsEMT

Member
Licensed User
Longtime User
I've been using ExitApplication, and it seems to work, but I can see where an Activity.Finish might be cleaner.

Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
.
.
' If pnlPatientType.Visible = True Then
ExitApplication
End If
 
Upvote 0
Top