Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setContentView(R.layout.main);
- // experiment with the ActionBar
- ActionBar actionBar = getActionBar();
- actionBar.hide();
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // The Action Bar is a window feature. The feature must be requested
- // before setting a content view. Normally this is set automatically
- // by your Activity's theme in your manifest. The provided system
- // theme Theme.WithActionBar enables this for you. Use it as you would
- // use Theme.NoTitleBar. You can add an Action Bar to your own themes
- // by adding the element <item name="android:windowActionBar">true</item>
- // to your style definition.
- getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
- setContentView(R.layout.main);
- // experiment with the ActionBar
- ActionBar actionBar = getActionBar();
- actionBar.hide();
- }
- public class MagicActivity extends Activity
- <application
- ...
- android:theme="@android:style/Theme.Holo" >
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- ....
- android:theme="@android:style/Theme.WithActionBar" >
- <application
- android:name="com.xxx.yyy.Application"
- android:debuggable="false"
- android:icon="@drawable/icon"
- android:label="@string/app_name"
- android:theme="@style/Theme.NoTitle"> // remove this line if you have this in your code
- <activity
- android:name="com.xxx.yyy.Activity"
- android:configChanges="orientation|keyboardHidden|screenSize"
- android:theme="@style/Theme.NoTitle" // remove this line if you have this in your code
- android:windowSoftInputMode="adjustResize|stateHidden" >
- ActionBarActivity actionBarActivity = (ActionBarActivity)getActivity();
- ActionBar actionBar = actionBarActivity.getSupportActionBar();
- android.support.v7.app.ActionBar ab = getSupportActionBar();
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
- <application
- android:name="com.xxx.yyy.Application"
- android:debuggable="false"
- android:icon="@drawable/icon"
- android:label="@string/app_name"
- android:theme="@style/Theme.NoTitle"> // remove this line if you have this in your code
- <activity
- android:name="com.xxx.yyy.Activity"
- android:configChanges="orientation|keyboardHidden|screenSize"
- android:theme="@style/Theme.NoTitle" // remove this line if you have this in your code
- android:windowSoftInputMode="adjustResize|stateHidden" >
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // The Action Bar is a window feature. The feature must be requested
- // before setting a content view. Normally this is set automatically
- // by your Activity's theme in your manifest. The provided system
- // theme Theme.WithActionBar enables this for you. Use it as you would
- // use Theme.NoTitleBar. You can add an Action Bar to your own themes
- // by adding the element <item name="android:windowActionBar">true</item>
- // to your style definition.
- getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
- setContentView(R.layout.activity_main);
- // Hide the status bar for Android 4.1 and higher
- View decorView = getWindow().getDecorView();
- // Hide the status bar.
- int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
- decorView.setSystemUiVisibility(uiOptions);
- // Remember that you should never show the action bar if the
- // status bar is hidden, so hide that too if necessary.
- ActionBar actionBar = getActionBar();
- actionBar.hide();
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- // experiment with the ActionBar
- ActionBar actionBar = getActionBar();
- actionBar.hide();
- }
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_detail);
- getSupportActionBar().setDisplayHomeAsUpEnabled(false);
- }
Add Comment
Please, Sign In to add comment