Android Asyntask: Use weak reference for context to avoid device rotate screen

后端 未结 3 1518
-上瘾入骨i
-上瘾入骨i 2020-12-07 22:30

In Apress Pro Android 4 the author has said that:

[...] context of currently running activity will no longer be valid when the device is rot

3条回答
  •  一个人的身影
    2020-12-07 23:25

    If you want to restore the previous activity, why not go for onSaveInstanceState and restore it later on.

    Check this link for more details

    Saving application state

提交回复
热议问题