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

后端 未结 8 1197
后悔当初
后悔当初 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:35

    In my case this behavior was triggered by resume from lock screen. No idea why but after adding empty overloaded function it was fixed (but I tested it only on my HTC Wilfire). It may be a different bug thou.

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        /* Workaround a probable Android bug with fullscreen activities:
         * on resume status bar hides and black margin stays, 
         * reproducible half of the time when coming back from lock screen 
         * (tested on HTC Wildfire)
         * No idea why but this empty overload method fixed it.
         */
    }
    

提交回复
热议问题