Why would I ever want `setRetainInstance(false)`? - Or - The correct way to handle device rotation

前端 未结 2 733
你的背包
你的背包 2021-02-13 02:44

Please correct me if I\'m wrong on any of this. This is a kind of clarifying question since I haven\'t seen it explicitly written anywhere.

In Android 4, you ca

2条回答
  •  再見小時候
    2021-02-13 03:05

    I don't know the answer to the first question. It should have been like that from the beginning. I guess someone at Google thought they're really smart coming up with this scheme.

    The second question, however, is much easier. This isn't the default because this isn't what Android develops have learned to expect. Android develops know the instance dies on rotation and expect it. Changing the default would have made a lot of developers really pissed off.

提交回复
热议问题