Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

SherlockFragmentActivity with TabHost, the item activity getActionBar null #1123

Closed
liufsd opened this issue Mar 6, 2015 · 1 comment
Closed

Comments

@liufsd
Copy link

liufsd commented Mar 6, 2015

I have to build a SherlockFragmentActivity with TabHost,and tab's item also use SherlockFragmentActivity.

//TabManagerActivity.java
TabManagerActivity extends SherlockFragmentActivity
{
  private TabHost tabHost;
  protected void onCreate(Bundle savedInstanceState) {
   .....
    tabHost = (TabHost) findViewById(R.id.tabHost);
  ....
      tabHost.addTab(tabHost,.....ItemSearchActivity.class);
...
}
}
//ItemSearchActivity.java

ItemSearchActivity extends SherlockFragmentActivity
{
.....
 protected void onCreate(Bundle savedInstanceState) {

...
getSupportActionBar() = null //  can not get actionBar here. why ???
}

}

@JakeWharton
Copy link
Owner

Nested activities do not have action bars. This is how the platform behaves.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants