I set the following property in application tag of manifeast
file. but it hides both titlebar(Actionbar) and Statusbar.Here i want to hide only the statusbar.
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
I set the following property in application tag of manifeast
file. but it hides both titlebar(Actionbar) and Statusbar.Here i want to hide only the statusbar.
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
for hiding only status bar add this code in oncrete of activity:
// Hide the Status Bar
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
and remove android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
from manifest
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
add this code to begining of your activity
Try the following code snippet:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* add below 2 lines*/
getWindow().clearFlags(android.view.WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
}