Where is the bundle of onSaveInstanceState saved?

后端 未结 5 1949
旧巷少年郎
旧巷少年郎 2020-12-15 18:21

I would like to know where the bundle \"outState\" of the method onSaveInstanceState(Bundle outState) is stored.

Is it stored in memory or in the device storage?

5条回答
  •  长情又很酷
    2020-12-15 18:58

    My guess would be in memory, but the best way to protect your data would be not to trust the system and encrypt it. Never trust the client (in this case the client being the OS).

    EDIT:

    To be clear, I'm not saying encrypt the bundle. Rather I'm saying that any sensitive data should not be put into the bundle. If you must put custom data in the bundle, then encrypt it.

    But ultimately you should keep as little sensitive data on the client as possible. This is the same reason a e-commerce site would only show the last 4 digits of a credit card.

提交回复
热议问题