A ambg Member Licensed User Longtime User Apr 4, 2017 #1 is there any way to completely clean the history open activities and the back key to close the application? For example 3 Activities (Main, 1,2) Start Main Activity In Main StartActivity(1) In 1 StartActvity(2) In 2 Activity.Finish StartActivity(Main) If the user then click back key go back to 1 and i want that close the application.
is there any way to completely clean the history open activities and the back key to close the application? For example 3 Activities (Main, 1,2) Start Main Activity In Main StartActivity(1) In 1 StartActvity(2) In 2 Activity.Finish StartActivity(Main) If the user then click back key go back to 1 and i want that close the application.
S sorex Expert Licensed User Longtime User Apr 4, 2017 #2 you can intercept the back event and do your own thing there. Upvote 0
A ambg Member Licensed User Longtime User Apr 4, 2017 #3 sorex said: you can intercept the back event and do your own thing there. Click to expand... And how intercept the back event and stop de application in this case? Upvote 0
sorex said: you can intercept the back event and do your own thing there. Click to expand... And how intercept the back event and stop de application in this case?
Erel B4X founder Staff member Licensed User Longtime User Apr 4, 2017 #4 If you are targeting Android 4.1 (API level 16) then you can use this code to close all activities: B4X: Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAffinity", Null) Upvote 0
If you are targeting Android 4.1 (API level 16) then you can use this code to close all activities: B4X: Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAffinity", Null)
A ambg Member Licensed User Longtime User Apr 4, 2017 #5 Erel said: If you are targeting Android 4.1 (API level 16) then you can use this code to close all activities: B4X: Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAffinity", Null) Click to expand... Works fine. Thanks Upvote 0
Erel said: If you are targeting Android 4.1 (API level 16) then you can use this code to close all activities: B4X: Dim jo As JavaObject jo.InitializeContext jo.RunMethod("finishAffinity", Null) Click to expand... Works fine. Thanks