savestate

How to use onSavedInstanceState example please

青春壹個敷衍的年華 提交于 2019-11-26 01:37:37
问题 I\'m confused when it comes down to saving a state. So I know that onSaveInstanceState(Bundle) is called when the activity is about to be destroyed. But how do you store your information in it and bring it back to its original state in onCreate(Bundle savedInstanceState) ? I don\'t understand how this bundle will restore information. It would be helpful if someone can provide an example. The Dev guide doesn\'t do a good job of explaining this. public class Conversation extends Activity {

What is the best way to save game state?

爷,独闯天下 提交于 2019-11-25 22:56:13
问题 I find the best way to save game data in Unity3D Game engine. At first, I serialize objects using BinaryFormatter . But I heard this way has some issues and is not suitable for save. So, What is the best or recommended way for saving game state? In my case, save format must be byte array. 回答1: But I heard this way has some issues and not suitable for save. That's right. On some devices, there are issues with BinaryFormatter . It gets worse when you update or change the class. Your old