Thanks Kumar. It looks like I will need to override the back button
and track my own state. :( We have been having some discussions on
StackOverFlow concerning this problem I'm having.

http://stackoverflow.com/questions/2568755/typical-search-result-and-detail-workflow-staying-within-an-android-tab

Basically what I want is the functionality similar to a web browser
with tabs containing their own history stack, independent of each
other. People expect the back button to act on the history of the tab
they are on, just like it does in a web browser.

It seems like Android tabs are not designed to do this. However, I
wonder if an ActivityGroup could do this? I tried using one for this,
but I haven't gotten it to work. Any thoughts appreciated.

Justin


On Apr 3, 9:05 am, Kumar Bibek <[email protected]> wrote:
> Well, here is a method that I can think of.
>
> 1. Create multiple View classes which prepare the layout and handle
> all the actions on that view.
> One for each, SearchView, ResultView and DetailView.
>
> 2. In the activity, get the first view and set it as content to the
> activity.
>
> 3. When the user navigates, keep an ArrayList of Views so that you can
> maintain the state of the previous screens.
>
> 4. Handle the Back button press, and change the Activity's content to
> the required view.
>
> Instead of setting the content, you can also use a simple ViewFlipper
> to create animations while changing views.
>
> Thanks and Regards,
> Kumar Bibek
>
> On Apr 3, 12:21 am, Justin Grammens <[email protected]> wrote:
>
>
>
> > So, I've been banging my head looking for a good solution for a few
> > days and am stuck. I have a search screen (Activity) in a tab, and
> > after the user enters a value and clicks "search" I would like the
> > results to come back in that same tab, and then if an item from the
> > results is selected, to show more detailed results in that same tab.
> > I have it all working now in separate activities, and even the first
> > step working in a tab, but as soon as I call.
>
> > startActivity(i);
>
> > for the results Activity, the results leave the tab!
>
> > I am having a very difficult time getting this flow to work all under
> > a tab. Any thoughts on how to make this happen?
>
> > I keep hearing that views should be used inside of activities, but am
> > I then to assume that all the logic I have right now for 3 activity is
> > needs to go inside 1 activity and then I need to handle setting the
> > content and state for each of these cases? Plus, won't the history
> > stack not work as pressing the back button will take the user out of
> > the application, instead of taking them from say the search result to
> > the search screen, or the details to the search results, etc. This
> > seems like a mess.
>
> > Can anyone show a more complex example of tabs or how one might have a
> > simple search, result and detail workflow staying in a tab?
>
> > I have seen a few questions on this concept of keeping sub activities
> > " within a tab ", but no good resolution. Please help.

-- 
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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to