android - Is it idiomatic to call FEATURE_ACTION_BAR from code -


my question related activating actionbar in android app. more idiomatic getwindow().requestfeature(window.feature_action_bar) or more idiomatic force through theme using ?

if you're asking "best practice" recommended google, take @ sample applications on developer's page. you'll notice don't see requestfeature() used. action bar default holo themes, in cases don't need address problem @ all.

even if you're using new compatlibrary, should use theme. new action bar guide doesn't mention requestfeature().

edit:

ah, demos did have use of this. however, "normally set activity's theme" , tell how instead.

 // action bar window feature. feature must requested  // before setting content view. set automatically  // activity's theme in manifest. provided system  // theme theme.withactionbar enables you. use  // use theme.notitlebar. can add action bar own themes  // adding element <item name="android:windowactionbar">true</item>  // style definition.  getwindow().requestfeature(window.feature_action_bar); 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -