How to handle screen orientation change when progress dialog and background thread active?

前端 未结 28 1674
轮回少年
轮回少年 2020-11-22 07:03

My program does some network activity in a background thread. Before starting, it pops up a progress dialog. The dialog is dismissed on the handler. This all works fine, exc

28条回答
  •  天涯浪人
    2020-11-22 07:59

    When you change orientations , Android kill that activity and created new activity . I suggest to use retrofit with Rx java . which handle crashes automatically .

    Use these method when retrofit call.

    .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread())

提交回复
热议问题