Android Question Activity navigation question

little3399

Active Member
Licensed User
Longtime User
Hi,
I have a project has this navigation ...

upload_2014-8-3_15-43-24.png


But I found this navigation mode maybe exist a problem ...
When I navigation to Option Select (Activity) and press Back Key , the navigation will came back to Opt1_Activity1 ...
Is there good way to solve this problem? Tks .... I have no idea about this ....
 

sirjo66

Well-Known Member
Licensed User
Longtime User
I am not an expert but I try to help you ;)

In "Activity_Pause" event, if you don't write any code, the activity close and "return" to the activity that has call it,
so if Opt1_Activity1 call OptionSelect, it's normal that when the customer press backKey, it "return" to Opt1_Activity1.

If you want to "return" to a wanted activity, you need to insert this code into Activity_Pause event on OptionSelect activity:
B4X:
StartActivity(ItemList)
or StartActivity("ItemList"), I don't remember the exact words, try it

Sergio
 
Upvote 0

DouglasNYoung

Active Member
Licensed User
Longtime User
t would seem to me, that if Opt1_Activity only calls Opt1_Activity1 then you could make these one activity and the problem is solved!

Douglas
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
Just catch the back key and test which activity you are currently in. If in one of the activity1 options then call the activity menu else allow the back key to work as normal.

Regards,
RandomCoder
 
Upvote 0
Top