Hide Status bar On a Tablet Running ICS - android

i want to hide status bar in tablet ics in my application
When i include this code. `
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
then the app crashed,
Is there any way to disable the status bar..
Or please give me a suggestion for hiding home button press
Do anyone have an idea in this topic,please help me tackling this problem

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(...);

First of all, share us your code. But I think the reason is that you put this line after setContentView(..) and you need to put it before

Related

Hide Title Bar in Service.Is it possible?

I want to hide title bar in Service without using Activity.Can I somehow do so?I thought it might work with requestWindowFeature and NO_TITLE_FEATURE but android studio says that it can't resolve this method.May be somebody can help me?
No, the title bar is part of the Activity. Therefore the Activity must control what window features it uses or doesn't use.

Very top bar with battery life and wifi status not showing up

Sorry for the simple question but I cant figure out whats going on with this. The theme of my layout is set to NoTitleBar and the gui shows that slim bar where you pull notifications down from but when I run my app on my galaxy nexus its not there. It just shows white space where that bar is supposed to be. How do I make this bar with battery life and such show up. thanks
check your activity declared in mainfest file ..put your theme as no title bar in your activity in manifest file..if problem is not solve then put your code for better understanding

How to hide the Status Bar?

I am trying to hide the status bar. I have tried the following things.
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
In the Manifest.XML I have added the above code.
And in the onCreate() I have added the following:
requestWindowFeature(Window.FEATURE_NO_TITLE);
// hide statusbar of Android
// could also be done later
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
But still I am unable to hide the status bar. Can anyone help?
The approaches you've taken would work on 2.3.X
But if you are talking about 4.0 tablets this is the code
LinearLayout layout = (LinearLayout)findViewById(R.id.layout);
layout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
If you're talking about a tablet you cannot get rid of the system bar but I suggest you look at this question:
Hide Status bar on Android Ice Cream Sandwich
Just make sure that you are writing above code lines before the line setContentView()?

Android: Getting an issue of hiding title and status bar

I am hiding status bar and title bar throught out my app by adding
android:theme="#android:style/Theme.NoTitleBar" in android manifest xml file. I am also adding
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
in each activity. I am able to hide them. But sometimes when my app is loaded it is pushing the page down by taking the statusbar and title bar space.
Can any one of you please help me.
You should declare one of the above things not both. Either you declare it in the manifest or do it programmatically. Performing both the tasks as you just mentioned can hamper the screen. See this for more details
Declare any one of them and clean and run the program once..

android spinner is showing hidden notification bar

In my app i make the app fullscreen. Means android title bar and notification bar is hidden here.
But when i click on the spinner the hidden notification bar gets visible for fraction of seconds. It is not happening with all the spinners in my app. But where i use a array,generated by a loop execution in the spinner adapter, it is only happening in that case.
I have come to know that it is a known bug in android. I also use the following style in spinner to resolve it.
In my app i make the app fullscreen. Means android title bar and notification bar is hidden here.
But when i click on the spinner the hidden notification bar gets visible for fraction of seconds. It is not happening with all the spinners in my app. But where i use a array,generated by a loop execution in the spinner adapter, it is only happening in that case.
I have come to know that it is a known bug in android. I also use the following style in spinner to resolve it.
true
true
#null
But still i cant solve this problem..
If anyone has any solution please let me know.
add this line before setContentView():
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Then u use requestWindowFeature(Window.FEATURE_NO_TITLE); in activity and it must be before of the setContentView(....) method

Categories

Resources