search

Home  >  Q&A  >  body text

android - Activity与Fragment执行任务的先后问题?

我的应用主界面是一个Activity四个Fragment,我想在Activity里进行基础数据的请求去存储,完成之后Fragment再使用这些数据,该怎样使Activity的任务执行完成后Fragment才会执行?

大家讲道理大家讲道理2772 days ago464

reply all(3)I'll reply

  • PHPz

    PHPz2017-04-17 17:42:46

    Isn’t it necessary to dynamically load the fregment after the request is successful?

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:42:46

    The onactivitycreate method of fragment is called after atctivity is executed.

    reply
    0
  • 迷茫

    迷茫2017-04-17 17:42:46

    Create the Fragment after the data request is successful; or create it in advance, and use the event bus EventBus and RxBus after the data request

    reply
    0
  • Cancelreply