Android theme, fullscreen and action bar

I have some problems with devices that have an action bar. When working on the phone, I want to go into full screen mode without a title and status bar. On tablets, I want to show an action bar, but still no title. Minsdk - 7! The setTheme method does not work when switching full-screen mode, so I cannot have two themes. Is there a way to show the action bar in full screen? The support library does not support the action bar.

The only reason I want to do this in the first place is that for some reason they did not break backward compatibility by moving the menu key to the action bar. An easy solution for this according to the docs is to add android: showAsAction = "ifRoom" to the menu items. But that means absolutely nothing.

I also tested a lot of the solutions I found on google that supposedly switch full screen mode. None of them work on any of my devices, so please do not indicate what you read if you did not use it yourself.

EDIT: I solved it. The problem is that you need to specify the Holo theme to bring back the action bar. Otherwise, it will not be displayed. I added this to my main activity.

@Override public void setTheme(int resid) { if(isTablet(this)) { super.setTheme(android.R.style.Theme_Holo); return; } super.setTheme(resid); } 
+2
android android-actionbar
Sep 24
source share
1 answer

On tablets, I want to show an action bar, but still not a title

The action bar replaces the title bar. There is no concept of an activity that has an action bar and a title bar.

Is there a way to show the action bar in full screen?

AFAIK, no, by definition.

The support library does not support the action bar.

ActionBarSherlock provides backport action panels for API level 7 and above.

An easy solution for this according to the docs is to add android: showAsAction = "ifRoom" to the menu items. But that means absolutely nothing.

It certainly doesn’t do anything unless you have an action bar. If you need full-screen mode, you will need to minimize your own menu. IMHO, most full-screen applications have done this already (for example, the game is in the style of "menu").

+2
Sep 24
source share



All Articles