Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android tabs - starting a new activity

There are 4 Tabs in a TabHost, let them be A, B, C, and D. Now each one is just an index page and clicking on any of them shows a different activity.

The problem is that I need to start another activity when the user selects something from the content displayed in the tab. The other activity should also be displayed in the parent tab itself. Is it possible? Or will I have to try something else?

like image 433
JaVadid Avatar asked Jan 23 '23 20:01

JaVadid


2 Answers

Try this, found this solution in android cookbook, http://androidcookbook.com/Recipe.seam;jsessionid=5424397F3130CE7769FF47DD67742911?recipeId=1693&recipeFrom=ViewTOC

like image 77
Rukmal Dias Avatar answered Feb 04 '23 03:02

Rukmal Dias


Can't you change the contentView of your tab instead of starting a new Activity ?

Maybe I'm wrong but I think also that starting an activity in a tab isn't possible because the TabView is hosted in a activity and not the opposite (Tabview don't host an activity per Tab).

like image 26
tbruyelle Avatar answered Feb 04 '23 04:02

tbruyelle