Ok some background:

Say you have two ways of displaying content, in a list or in a detail
view (only one item is shown). When the user launches the application,
depending on the intent data (or lack there of) I have made the
correct logic to either show the detail view or the list view. I
currently have this implemented in the OnCreate of my activity. It
works correctly.

My question is this, what's the best way to handle the Activity stack?
Here is one senario, A user passed no data into the launching intent,
the list view is displayed. The user clicks on the list item and then
a new intent is raised which calls the same activity (in singleTop
mode) with data in the intent. The user now sees the detail view.
However, when the user hits the Back button, it takes the user back to
the home screen. I think the most intuitive approach would be to take
the user back to the list. I understand this is happening because I am
using the singleTop mode. But if I don't, and the user toggles the way
to display via my implemented menu, there could be many activities
created in the stack and hitting the back button would require
multiple hits to go to the home screen.

Basically what I think would be ideal is the following behavior:

[intent without data] = List -> User selects item -> Detail -> User
hits back -> List -> User hits back -> Home Screen
[intent with data] = Detail -> User toggles view in the menu -> List -
> user hits back -> Home screen


I'm sure I can do this with 3 activities a routing activity, a list
activity, and a detail activity. I am sure I am just missing something
simple and would like to keep a lot of the common code and functions
in one class if possible.

Thoughts?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to