Reputation: 151
I am new to android development but in the past few weeks I have been able to create a very basic app which is essentially a lookup table with two levels of groupings; category and subcategory followed by the item level detail. Users can scroll through the categories click one and go down to the specific subcategories within that category and finally clicking on a subcategory gets them to the item level detail which they are looking for.
I have read a lot and still learning but using my limited knowledge of activities, views, intents, cursors etc I created the app in the following structure:
My main activity at launch is Tab which creates two tabs; All Items and Favourites. It also starts the Category ListActivity in the FrameLayout.
Side Note Currently favourites is not created but what i would like to have is a star icon beside each item so users can click on it and favourite and it would show up in the favourite tab. If anyone has a good tutorial on this that would be greatly appreciated.
The main.xml has been created to the standard layout for Tabs but including a ListView within the FrameLayout which seems to work for the category listactivity but when you click on a category the subcategory activity is started but no tabs appear like they did in category. I tried setContentView(R.layout.main)
in the beginning of the the onCreate()
for the subcategory but it didn't help... I am stuck in figuring this out.
Any suggestions on what I am missing or should do would be greatly appreciated.
Cheers
Upvotes: 0
Views: 108
Reputation: 151
I used the following tutorial and code and was able to get multiple activities under a tab by using ActivityGroup.
The following is a link to the tutorial http://ericharlow.blogspot.com/2010/09/experience-multiple-android-activities.html
Upvotes: 1
Reputation: 151
From what I understand, you want the Category ListActivity and Subcategory ListActivity to appear the same tab. Though this may not be the ideal solution, I think you can achieve this by using an ActivityGroup. Here is a link with more information:
Upvotes: 0