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

后端 未结 10 1931
春和景丽
春和景丽 2020-12-31 04:17

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 cu

10条回答
  •  一向
    一向 (楼主)
    2020-12-31 04:21

    Following the info of Sigwann, here my code....

    public boolean isFullScreen() {
        int flg = getWindow().getAttributes().flags;
        boolean flag = false;       
        if ((flg & WindowManager.LayoutParams.FLAG_FULLSCREEN) == WindowManager.LayoutParams.FLAG_FULLSCREEN) {
            flag = true;
        }
        return flag;
    }
    

    Simple, but works!

提交回复
热议问题