android Exit from full screen mode

前端 未结 3 536
独厮守ぢ
独厮守ぢ 2020-12-03 08:26

I am working in Android. I need to show my activity in Full screen mode, and i did this using following code.

    getWindow().setFlags(WindowManager.LayoutPar         


        
3条回答
  •  执念已碎
    2020-12-03 08:41

    From ICS when the Fragment is attached to the Activity, the FULL Screen mode is reseted. The best approach is to add the code

    getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); getActivity().findViewById(R.id.root).setSystemUiVisibility(View.STATUS_BAR_HIDDEN);

    in the callback onActivityCreated of the fragment(layout id root is the root layout of the Activity).

提交回复
热议问题