java – How to perform an action after drawing an Activity (fragment)

Question:

Is there a method from which it is possible to influence the newly displayed activity? I need to restart the view as soon as it is rendered. And you need to draw to find out its size. Then immediately perform another action with this data.

Answer:

This code helps me:

 myView.postDelayed(new Runnable() {
        @Override
        public void run() {
            ...нужные действия           
        }
 },100);

already rendered on post View .

UPD: changed post to postDelayed – this is how it should work

Scroll to Top