Which Activity method is called after all the layout methods?

前端 未结 2 1594
野趣味
野趣味 2021-02-01 20:48

I need to do something in an Activity after all the layout methods have been called, all the Views are in place and the Activity is ready

2条回答
  •  醉梦人生
    2021-02-01 21:01

    There's no magic method for that AFAIK. Suggest adding a Handler to your activity class, and post() a Runnable to it from onCreate() that contains the code you want to run.

    If that's still too early you can postDelayed() instead.

提交回复
热议问题