android what to use instead of onRestart() in a fragment

前端 未结 5 1292
既然无缘
既然无缘 2021-01-20 15:34

I\'m dealing with .setVisibility() of a view, inside my main fragment at app start. So what I want is that the view is invisible on app sta

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-20 16:16

    You can use onRestart() on the activity, making it call whatever method you want on the fragment by making use of getFragmentManager().findFragmentById(R.id.your_fragment). When a fragment gets restarted its underlying activity got restarted so its onRestart() method was called.

提交回复
热议问题