androidandroid-intentandroid-tabhost

Problem with Intents and TabHost in Android


I have an Android App that uses a TabHost layout. Every tab calls the same Activity on which there is a ListView that loads data from a DB.

Everything runs fine but the problem is that when the user clicks a ListView item and I call an intent to load, the new activity goes "full screen" and hides the TabHost.

I call the new intent in this way:

Intent i=new Intent(this, MyActivity.class);
startActivity(i);

I would like to maintain visibility of TabHost even if I change Activity, can anyone help me?


Solution

  • The activity in your TabHost needs to be an ActivityGroup.

    http://united-coders.com/nico-heid/use-android-activitygroup-within-tabhost-to-show-different-activity