Android Question A question asked by an expert beginner ^_^

LucaMs

Expert
Licensed User
Longtime User
Since I have not used actionbars (I used B4A as if he were VB.Net :))

I have a "nice" Exit button in every activity, which, in reality, is a "back".

So, to return to the Main, sometimes the user must repeatedly press "Exit".

In some activity I could add a "Home" button or "Main", but in this case, what do I do? One startActivity (Main) (including Activity.Finish in the current one)? Do not remain suspended all previous calls to the acitivities?
 

mc73

Well-Known Member
Licensed User
Longtime User
If you're finishing activities every time you enter a new one, then there should be no problem at all.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
When I go from one activity to another I rarely use Activity.Finish because in most cases I want to go back to the calling Activity and for this the Back button of the system does it, no need for an extra button. This is the 'standard' way Android works.
I use Activity.Finish only when I don't want to go back to the calling Activity.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
When I go from one activity to another I rarely use Activity.Finish because in most cases I want to go back to the calling Activity and for this the Back button of the system does it, no need for an extra button. This is the 'standard' way Android works.
I use Activity.Finish only when I don't want to go back to the calling Activity.

I "locked" the back button on all the activities.
Sometimes the user wants to go back to the calling, sometimes he might prefer to go at the main;
I wanted to ask if, in this second case, I could have execute StartActivity(Main) without affecting anything (probably there will be a queue of calls)
 
Upvote 0

JTmartins

Active Member
Licensed User
Longtime User
Klaus, does that work ?

I mean, can we have the activity.finish and code statements ater that will execute ?

I never actualy tried it, as I thought it wouldn't work
 
Upvote 0
Top