Android call back after layout rendering has completed?

19,420

See ViewTreeObserver

More info here: https://stackoverflow.com/a/7735122/338479

Share:
19,420

Related videos on Youtube

Mithun Sreedharan
Author by

Mithun Sreedharan

Tweets @mithunp Works @QBurst

Updated on June 04, 2022

Comments

  • Mithun Sreedharan
    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 the onCreate gets finished. A blank screen is shown till the service get bind

  • TheLibrarian
    TheLibrarian about 5 years
    Does not work, onResume does not guarantee that all views will be rendered by this point (e.g. ViewPager's fragments).

Related