Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to determine if Android app is running full screen?

Tags:

i was just wondering if there was a simple way to see if an application running on android is currently in full screen. is there a way to query android to see if you're currently in full screen mode or something like that?

like image 227
user436605 Avatar asked Jan 10 '11 01:01

user436605


People also ask

How do I put Android in fullscreen mode?

Using Android Studio (current version is 2.2. 2 at moment) is very easy to add a fullscreen activity. See the steps: Right click on your java main package > Select “New” > Select “Activity” > Then, click on “Fullscreen Activity”.

What is fullscreen app Android?

Full! screen lets you hide the system navigation bar and notification area on your Android phone or tablet so you can use that space for apps and games in full screen mode. It's not just crashing your system UI, though. Full! screen places minimalist replacement buttons tucked away in the corners.


2 Answers

Just to complete on Sigwann answer:

boolean fullScreen = (getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
boolean forceNotFullScreen = (getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN) != 0;
boolean actionbarVisible = getActionBar().isShowing();
like image 81
VeV Avatar answered Dec 04 '22 04:12

VeV


I guess Commonsware wanted to say getWindow().getAttributes() and not getWindow().getFlags(); since getFlags does not exist as far as I know. At least it is not in doc.

you need to read getWindow().getAttributes().flags, which is an int.

WindowManager.LayoutParams lp = getWindow().getAttributes();
int i = lp.flags;

FLAG_FULLSCREEN = 1024 according to android documentation. so your flag is the 11th bite of lp.flags

if this bite = 1, full screen is activated.

like image 44
Sigwann Avatar answered Dec 04 '22 05:12

Sigwann