有没有一种方法,以确定是否Android应用程序运行时全屏?全屏、应用程序、方法、Android

2023-09-04 07:03:14 作者:眼盲

我只是想知道是否有一种简单的方法,如果在Android上运行的应用程序目前处于全屏。有没有一种方法来查询机器人,看看您目前在全屏模式或类似的东西?

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?

推荐答案

我想Commonsware想说getWindow()的getAttributes(),而不是getWindow()getFlags()。因为getFlags不会因为据我所知存在。至少它不是在文档。

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.

您需要阅读getWindow()的getAttributes()的标志,这是一个int。

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


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

FLAG_FULLSCREEN =根据Android的文档1024。 所以你的标志是lp.flags 11日叮咬

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

如果这个咬= 1,全屏幕被激活。

if this bite = 1, full screen is activated.