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); }
android android-actionbar
user1194949 Sep 24 2018-12-12T00: 00Z
source share