android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
Tu dois appliquer ce code sur les activity déclaré dans ton manifest.
1 2 3 4 5 6
| <activity
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:name=".TonActivity"
android:label="@string/app_name"
...
</activity> |
Si tu veux que cela soit appliquer sur ton application alors il faut cette option sur dans le tag de ton application.
1 2 3 4
| <application
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
...
</application> |
Pour l'autre solution :
1 2 3 4 5
|
// Hide status bar
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Show status bar
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); |
Cela te permet de faire la modification non pas dan le manifest mais à partir de ton actvity onCreate() de ton code.
Ce code doit se trouver à cet endroit de ton activity :
1 2 3 4 5
|
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.xxx); |
Il faut que le flags soit fait avant le setContentView sinon ca ne fonctionnera pas
Partager