onTouchEvent() will not be triggered if setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) is invoked

后端 未结 8 667
有刺的猬
有刺的猬 2021-02-01 16:11

I call

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) 

when my app starts to make my app able to displa

8条回答
  •  醉话见心
    2021-02-01 16:32

    This did work for me:

     setOnSystemUiVisibilityChangeListener(new OnSystemUiVisibilityChangeListener() {
            @Override
            public void onSystemUiVisibilityChange(int visibility) {
                if ((visibility & SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) {
                    // show my app UI
                }
            }
        });
    

提交回复
热议问题