0

I have done TabActivity with this code:

addTab(publication, "First", My_Files.class);
addTab(shop, "Second", Others.class); 

private void addTab(String labelId, int drawableId, Class<?> c)
{
    TabHost tabHost = getTabHost();  // The activity TabHost

    Intent intent = new Intent(this, c);
    TabHost.TabSpec spec = tabHost.newTabSpec("tab" + labelId); 

    View tabIndicator = LayoutInflater.from(this).inflate(R.layout.tab_indicator, getTabWidget(), false);
    TextView title = (TextView) tabIndicator.findViewById(R.id.title);
    title.setText(labelId);
    ImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);
    icon.setImageResource(drawableId);

    spec.setIndicator(tabIndicator);
    spec.setContent(intent);
    tabHost.addTab(spec);
}

In these first and second tabs, I have ListViews with some context where user press it and it goes to other Activity with this code:

    Intent intent = new Intent("android.app.reader.FILES");  
    intent.putExtra("publicatonName", "fileName");
    startActivity(intent);

But there disappear my TabActivity, but I still want to use it like iPhone UITabBar with UINavigationController

So now I am thinking that when I go to other Activity I need to change current TabActivity button class target to current and somehow my Tab Bar Activity should be visible.

Maybe someone could help me.

Thanks.

twlkyao
  • 14,302
  • 7
  • 27
  • 44
Streetboy
  • 4,351
  • 12
  • 56
  • 101

1 Answers1

1

ActivityGroup, which will be the container of your other Activities. When the user clicks one of the buttons, you'd get a reference to the LocalActivityManager, and use it to start, and embed the inner activity. get some experience from here and also

Anand Tiwari
  • 1,583
  • 10
  • 22