Android Question Activity, StartActivity etc...

nibbo

Active Member
Licensed User
Longtime User
Hi,
I have an app with several distinct activities.
What is the best way to get from one to the other and then back again?

In my example I have an order entry app.
I use main as the log in, I then start a dashboard and have a 'New Order' button which starts the Ordering activity.

In Main I do a StartActivity(Dashboard) and when the New Order button is clicked I do a StartActivity(Order). On completion I want to go back to the Dashboard.
I tried a StartActivity(Dashboard) which seems to work but if I click 'New Order' again it seems to resume the Order rather than start a new activity, ActivityCreate is not fired!
Activity.Finish and exit activity in the order activity closed the entire app.

Tried to find a tutorial but there are no examples that say to do anything differently.

Many thanks
 

DonManfred

Expert
Licensed User
Longtime User
Activity.Finish after StartActivity(Dashboard)

I may wrong but using this will cause the dashboard get removed from stack. So when the user then quit the order.-activity he will be go to main again instead dashboard.
You may correct me if i´m wrong (i´m just thinking loud) :)
 
Upvote 0

nibbo

Active Member
Licensed User
Longtime User
it works.
Thanks Luca

I did have it like this but it was closing the application completely; honest it was!
I have put the Activity.Finish back in and now it works as I would have expected and does fire the Activity_Create in the order activity so all is good in the world again.

Thanks to all for the replies.
 
Last edited:
Upvote 0
Top