elitevenkat Active Member Licensed User Longtime User May 20, 2018 #1 I had tried Code: Copy Activity.Finish i tried this code by Erel but the app remains open. Any other method to close the app complete ? Code: Copy public Sub CloseAll Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAffinity",Null) End Sub Multiple activities and 2 services are being run,
I had tried Code: Copy Activity.Finish i tried this code by Erel but the app remains open. Any other method to close the app complete ? Code: Copy public Sub CloseAll Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAffinity",Null) End Sub Multiple activities and 2 services are being run,
f0raster0 Well-Known Member Licensed User Longtime User May 20, 2018 #2 I'm almost 100% sure it only can be done maually for the user ahh maybe this can help (post #4) https://www.b4x.com/android/forum/threads/how-force-kill-app.47692/#post-295547 ↑ Code: Activity.Finish ExitApplication StopService(lala) Oh i know it but i want stop other app not me app Click to expand... Last edited: May 20, 2018 Upvote 0
I'm almost 100% sure it only can be done maually for the user ahh maybe this can help (post #4) https://www.b4x.com/android/forum/threads/how-force-kill-app.47692/#post-295547 ↑ Code: Activity.Finish ExitApplication StopService(lala) Oh i know it but i want stop other app not me app Click to expand...
elitevenkat Active Member Licensed User Longtime User May 20, 2018 #3 Thanks for the reply. I think I have not put my question clearly. Actually I want to close my own runnkng app having multiple activitirs and 2 services and not any other running app. The app seems to be getting closed but remains in the back ground. It does not go away from the device memory. The link you had reffeted seems to explain about closing another running app. Upvote 0
Thanks for the reply. I think I have not put my question clearly. Actually I want to close my own runnkng app having multiple activitirs and 2 services and not any other running app. The app seems to be getting closed but remains in the back ground. It does not go away from the device memory. The link you had reffeted seems to explain about closing another running app.
johndb Active Member Licensed User Longtime User May 20, 2018 #4 elitevenkat said: Thanks for the reply. I think I have not put my question clearly. Actually I want to close my own runnkng app having multiple activitirs and 2 services and not any other running app. The app seems to be getting closed but remains in the back ground. It does not go away from the device memory. The link you had reffeted seems to explain about closing another running app. Click to expand... Add this to the manifest. Code: Copy SetActivityAttribute(Main, "android:excludeFromRecents", "true") Upvote 0
elitevenkat said: Thanks for the reply. I think I have not put my question clearly. Actually I want to close my own runnkng app having multiple activitirs and 2 services and not any other running app. The app seems to be getting closed but remains in the back ground. It does not go away from the device memory. The link you had reffeted seems to explain about closing another running app. Click to expand... Add this to the manifest. Code: Copy SetActivityAttribute(Main, "android:excludeFromRecents", "true")
Semen Matusovskiy Well-Known Member Licensed User May 20, 2018 #5 For Android 5+ (SDK 21+) Code: Copy Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAndRemoveTask", Null) Upvote 0
For Android 5+ (SDK 21+) Code: Copy Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAndRemoveTask", Null)
elitevenkat Active Member Licensed User Longtime User May 20, 2018 #6 johndb said: Add this to the manifest. Code: Copy SetActivityAttribute(Main, "android:excludeFromRecents", "true") Click to expand... works perfectly thanks a lot Upvote 0
johndb said: Add this to the manifest. Code: Copy SetActivityAttribute(Main, "android:excludeFromRecents", "true") Click to expand... works perfectly thanks a lot
elitevenkat Active Member Licensed User Longtime User May 20, 2018 #7 Semen Matusovskiy said: For Android 5+ (SDK 21+) Code: Copy Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAndRemoveTask", Null) Click to expand... Thanks for your reply. Mine is android 7 and sdk 27. This gives error java.lang.RuntimeException: Method: finishAndRemoveTask not found in: com.eoos.android.main Upvote 0
Semen Matusovskiy said: For Android 5+ (SDK 21+) Code: Copy Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAndRemoveTask", Null) Click to expand... Thanks for your reply. Mine is android 7 and sdk 27. This gives error java.lang.RuntimeException: Method: finishAndRemoveTask not found in: com.eoos.android.main
Semen Matusovskiy Well-Known Member Licensed User May 20, 2018 #8 It's stange. The attached sample works in emulators and on my phone (Oreo 8.1) Probably, you use another releases than I. I use B4A 8.00, JavaObject 2.05. According https://developer.android.com/refer...ityManager.AppTask.html#finishAndRemoveTask(), finishAndRemoveTask is alive up to now. Attachments CloseApp.zip CloseApp.zip 8 KB · Views: 888 Upvote 0
It's stange. The attached sample works in emulators and on my phone (Oreo 8.1) Probably, you use another releases than I. I use B4A 8.00, JavaObject 2.05. According https://developer.android.com/refer...ityManager.AppTask.html#finishAndRemoveTask(), finishAndRemoveTask is alive up to now.