Typical Search, Result and Detail Workflow Staying Within an Android Tab

Posted by Justin on Stack Overflow See other posts from Stack Overflow or by Justin
Published on 2010-04-02T19:31:18Z Indexed on 2010/04/02 19:33 UTC
Read the original article Hit count: 178

Filed under:
|
|
|
|

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 the activity to process he search results... i.e.

startActivity(i);

for the results Activity, the results displayed are not in 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 Android views should be used instead of activities, but am I then to assume that all the logic I have right now for 3 activity 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 activities "within a tab", but no good resolution. Please help.

© Stack Overflow or respective owner

Related posts about android

Related posts about tab