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


edited add more details: (originally asked 2 months ago...still haven't found solution)

i have activity complicated view. not complicated in technical sense...there's lot going on. activities in particular app set fullscreen notitlebar, , they're set landscape orientation. noticed on in development when app hidden , resumes, there infrequent tendency layout slide down vertically if make room titlebar , statusbar.

later on in development, app calls out various external intents. notice there more of tendency make same shift when resuming externally handled fired intent (such creating "chooser" intent or picking image). able reproduce inconsistently using exact same steps...sometimes happens doesn't. seems if there's race condition in between various phases of measuring , laying out. assume 1 of these steps system doing me checking fullscreen , notitlebar, , making necessary shift. happening late in cases.

i put bunch of logging, , calls invalidate(), requestlayout(), etc trying maybe catch race condition, problem seems external layouts. top() , bottom() values of root layout 0 , height of screen, respectively, when i'm logging while issue occurring.

is there other method of window, windowmanager or other system view-related object can force full remeasure, redraw, re-check current theme/style flags?

i had same problem , tried several aproches (as ones mentioned above). none of them worked. found 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 short flicker in procedure, @ least doensn't stay croped. clean solution still needs found. supports thesis there kind of timing or race problem.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -