Hi, I'm having some difficulties getting the TabActivity to work. Here's the implementation of the class:
public class Profile extends TabActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final TabHost tabHost = getTabHost();
if (tabHost.isEnabled()) {
Log.e("profile", "enabled");
}
tabHost.addTab(tabHost.newTabSpec(getString(R.string.friendReqs))
.setIndicator("requests")
.setContent(new Intent(this, FriendRequests.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
tabHost.addTab(tabHost.newTabSpec(getString(R.string.friends))
.setIndicator("photo list")
.setContent(new Intent(this, Settings.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
Log.e("profile", "add tabs");
tabHost.invalidate();
}
}
The problem is that I call this class from my main activity (which is a MapActivity if it matters) and when I do the TabActivity doesn't show. It registers the click on the option menu and it even starts the intent but the screen doesn't change..it just stays on the main activity and i see in the logs that the main activity gets resumed. I call it like this:
Intent p = new Intent(this,Profile.class);
p.putExtra(DBAdapter.KEY_USERID,userid);
startActivity(p);
Like I said...there are no errors (the classes called from the tabs exist of course), just no actions. I put some log commands into the onCreate function in the tabactivity (as you see) and they all get written into the log...I have no idea what I'm doing wrong here. Any help?