0

I have an activity which has four tab. first tab has list view and some list item . after clicking on list item i want to open an activity on the same tab (first tab). I couldn't find any solution of that.

help me !! Thanks

  • can use fragments...i have read on web that with newer API of Android recommend to avoid the use of Activity inside activity....http://developer.android.com/reference/android/app/TabActivity.html – Its not blank Sep 12 '12 at 12:09

1 Answers1

0

There is a way to open a new activity, which is with an Intent, so you can do the following:

Intent intent=new Intent(Activity.this or this,Activity2.class);
//here you can add the flags you might need
startActivity(intent);

The activity Activity.this or this is the one that launches the new Activity, so the code must be inside the Activity that is showing the tab you are using.For example, if you need to change the title you can add the following:

@Override
public void onResume()
{
    super.onResume();
    this.getParent().setTitle("Your title");
}
Javier
  • 181
  • 8