How to handle AsyncTask onPostExecute when paused to avoid IllegalStateException

后端 未结 5 775
灰色年华
灰色年华 2020-11-30 18:44

I appreciate the numerous postings regarding AsyncTask on a rotation change. I have the following problem when using the compatability lib and trying to dismiss a Dial

5条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 19:25

    On How to handle Handler messages when activity/fragment is paused I offer another approach using a BroadcastReceiver.

    I consider it cleaner more elegant and it offers the advantages that you can invoke code on your base fragment from everywhere within your app and by using sticky broadcasts your invocation can be "remembered" and executed after your fragment resumes.

提交回复
热议问题