Android: Settings button removed for Full ScreenActivity - android

Apparently when you make the activity full screen on android it removed the three dots at the top which I used for my settings.
I currently it set to full screen like the following:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Is there another way I can have my activity fullscreen and still access my inflateable menu?

requestWindowFeature(Window.FEATURE_NO_TITLE); says "get rid of the action bar". Your overflow (" three dots at the top") was in the action bar.
Either:
Get rid of requestWindowFeature(Window.FEATURE_NO_TITLE);, or
Create your own menu system, as part of the UI of the activity, rather than relying upon the action bar overflow

Related

Action overflow like button at the bottom in Nexus 4

I have designed this simple login screen.
In the LoginActivity, I have not declared onCreateOptionsMenu or onPrepareOptionsMenu.
But still I am getting overflow like button at the screen bottom right as shown in the below picture. When I click on it, it does not do anything.
If it were an Action item it would be in the Action Bar area not along with the device's native soft buttons.
Does anybody know how can it be resolved?
You'll need to set android:targetSdkVersion="14" or higher within your AndroidManifest.xml to get rid of the "menu button of shame".

Hide status bar on android

I am trying to hide the status bar. I have tried the following things.
This is for phones. I realize tablets can be different. It does hide the status bar when the layout has a bottom Tab. any ideas?
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 followingin the right place:
requestWindowFeature(Window.FEATURE_NO_TITLE);
// hide statusbar of Android
// could also be done later
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

Removal of the notification bar in an Android app

I'm developing an restaurant menu application that I want to be always on (the user shouldn't be able to go outside the application).
So far am able to override the back and home buttons, but I would like to get rid of the notification bar. Is there anyway to do such thing?
I've tried to set the app theme to fullscreen no title bar but that didn't do the trick. (For the home button i used the custom app in the application.xml.)
Here is a picture of the app for better understanding
You cannot remove bottom navigation bar (notification bar is that one on the top of the screen) on non-rooted device.
If you want to make kiosk mode, then you got two choices - turn your app into launcher or root your device and use tools like: http://ppareit.github.com/HideBar/ (there's open source solution as well but I do not have URL handy)
Put this onCreate()
this.requestWindowFeature(Window.FEATURE_NO_TITLE); // Removing the title
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
//notification bar
But you have to put it before the call to setContentView(R.id.x), otherwise it does not work

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 how to hide the status bar without hiding the title bar

In my application i am working with canvas. I am drawing on canvas. I put canvas color as white. When my app open the canvas is visible along with above status bar.
But i want my canvas should take the full screen. means that Notification status bar should disapear when i run that app bt not the title bar(bcz i m using some custom title bar)
How can i do that?
By using below code i gave custom title,
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);
Now i am trying to hide status bar using below code in activity-
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
and in AndroidManifest.xml
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
But it shows force close.
Give me a way how to do that?
It's enough to remove the line
requestWindowFeature(Window.FEATURE_NO_TITLE);
But if you want to display full screen (without action bar) write too
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_location_eb);
You can't use Window.FEATURE_CUSTOM_TITLE after setting Theme.NoTitleBar. It's enough to use just this theme. Do not set all these flags in code.
EDIT: Seems I misunderstood your question. I read it again carefully and now I see you're asking about Android 2.x and its notification bar. Your onCreate() method should look like this:
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.name);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
You mustn't set Theme.NoTitleBar or Theme.NoTitleBar.Fullscreen for this activity. Just use the default Theme or don't specify any theme at all.
Am going to tell you how to tackle the title bar and the system notification panel individually and perfectly.
Use one or both as per Your Need.
1.Do not apply any theme to the Activity through XML.
2.Now, go the corr. Java file and add these lines
inside onCreate()..
after super.onCreate()..
Part.a. to remove just Title Bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
Part.b. to remove the System notification panel
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Do not forget to follow them with the usual
setContentView(R.layout.activity_layout_name);

Categories

Resources