Open GoogleCodeExporter opened 9 years ago
I figured it out... change the setupTab void to accept an Intent as parameter...
Like this:
private void setupTab(final View view, final String tag, Intent intent) {
View tabview = createTabView(mTabHost.getContext(), tag);
TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(intent);
mTabHost.addTab(setContent);
}
... then in you onCreate event on your tabActivity you add following:
Intent myIntent = new Intent().setClass(this, myActivity.class);
setupTab(new TextView(this), "My tab", myIntent);
That should work...
Original comment by janu...@gmail.com
on 3 Feb 2011 at 8:19
this solution is not working
Original comment by deepansh...@gmail.com
on 14 Jun 2011 at 2:54
I did this same thing and for some reason Android will throw an
illegalStateException when setTab is called.
Original comment by kowalews...@gmail.com
on 3 Oct 2011 at 2:03
I figured out a solution to the problem. You need to extend TabActivity not
Activity to get these custom tabs setContent accepting an Intent instead of a
View.
Original comment by kowalews...@gmail.com
on 3 Oct 2011 at 2:09
Original issue reported on code.google.com by
noah.am...@gmail.com
on 22 Dec 2010 at 8:42