Hi everybody! Is possible to clear activity stack?
I've an application in which for some reason i can't call Activity finish in one activity, so when i press one button in 2nd activity i want to close also previous acitivity.
I have 2 option, call Activity.finish in previous act by using a simple CallSubDelayed, or using this code
https://stackoverflow.com/questions/7075349/android-clear-activity-stack
I tried to do 2nd option in this way, but doesn't work.. anyone can help me? Thanks
Thanks!
I've an application in which for some reason i can't call Activity finish in one activity, so when i press one button in 2nd activity i want to close also previous acitivity.
I have 2 option, call Activity.finish in previous act by using a simple CallSubDelayed, or using this code
https://stackoverflow.com/questions/7075349/android-clear-activity-stack
I tried to do 2nd option in this way, but doesn't work.. anyone can help me? Thanks
B4X:
Dim inte As Intent
inte.Initialize(Me,"")
Dim ob As JavaObject = inte
inte.Flags = Bit.Xor(ob.GetField("FLAG_ACTIVITY_NEW_TASK"),ob.GetField("FLAG_ACTIVITY_CLEAR_TASK"))
Activity.Finish
StartActivity(inte)
'Also tried
Dim inte As Intent
inte.Initialize(Me,"")
Dim ob As JavaObject = inte
ob.RunMethod("addFlags",Array(ob.GetField("FLAG_ACTIVITY_NEW_TASK")))
ob.RunMethod("addFlags",Array(ob.GetField("FLAG_ACTIVITY_CLEAR_TASK")))
Activity.Finish
StartActivity(ob)
'.... and ....
Dim inte As Intent
inte.Initialize(main,"")
Dim ob As JavaObject = inte
ob.RunMethod("addFlags",Array(ob.GetField("FLAG_ACTIVITY_NEW_TASK")))
ob.RunMethod("addFlags",Array(ob.GetField("FLAG_ACTIVITY_CLEAR_TASK")))
Activity.Finish
StartActivity(inte)
Thanks!