Force a full screen Activity to remeasure/redraw on resume?

后端 未结 8 1208
后悔当初
后悔当初 2021-01-05 05:14

Edited to add more details: (originally asked nearly two months ago...still haven\'t found a solution)

I have an activity with a somewhat complicate

8条回答
  •  死守一世寂寞
    2021-01-05 05:31

    i had exactly the same problem and also tried several aproches (as the ones mentioned above). None of them worked. However i found the following workaround:

     protected void onResume() {
       super.onResume();
       handler.postDelayed(new Runnable() {
          public void run() {
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                                 WindowManager.LayoutParams.FLAG_FULLSCREEN);
          }
       }, 1000);    
     }
    

    the view will do a short flicker in this procedure, but at least it doensn't stay croped. A clean solution still needs to be found. However this supports your thesis that there is some kind of timing or race problem.

提交回复
热议问题