Android call back after layout rendering has completed?
19,420
See ViewTreeObserver
More info here: https://stackoverflow.com/a/7735122/338479
Related videos on Youtube
Comments
-
Mithun Sreedharan almost 2 years
How can i create/bind a service only after activity layout is rendered?
-- Update
I have two tabs (both as separate activities)on the main activity and the data used for tabs comes from Service. Right now i'm binding service inside
onCreate
method. Issue is that layout is not rendered till all the statements inside theonCreate
gets finished. A blank screen is shown till the service get bind -
TheLibrarian about 5 yearsDoes not work, onResume does not guarantee that all views will be rendered by this point (e.g. ViewPager's fragments).