0

My problem is this:

I have 3 tabs, each with an assigned activity. From one of those activities, I want to launch a second activity in the first activity's view (thereby keeping the tabview visible).

So far, I have tried a few approaches:

1 - adding an intent to the first activity's class and then calling startActivityForResult(). This results in the tabview being lost and the second activity covering the screen.

2 - Using a ViewFlipper and adding the second activity as the flipped view.

If anyone can give any sort of direction on where I should be looking I will be extremely pleased :)

Thanks

1
  • you're going to run into some undesirable problems if you implement this. the default android tabs are not meant to be used like this.
    – james
    May 26, 2011 at 15:32

2 Answers 2

0

John all you are looking for is ActivityGroup here are the links that may prove useful to you

http://blog.henriklarsentoft.com/2010/07/android-tabactivity-nested-activities

http://ericharlow.blogspot.com/2010/09/experience-multiple-android-activities.html

1
  • Hi Folks, many thanks for your answers. In the end (after much fiddling) I binned the idea of launching multiple activities from a single tab and instead have used a viewflipper - which needed careful thought, but is much much easier.
    – John
    Apr 21, 2011 at 8:50
0

Use THis to start the new Activity

View view = getLocalActivityManager().startActivity("tab1", new Intent(this,tab1.class) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)) .getDecorView();

setContentView(view);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.