能否请您解释的onCreate和捆绑?请您、onCreate

由网友(老酒呛鼻)分享简介:我一直在寻找它,我只是不能似乎包裹自己周围的onCreate和捆绑。据我所知,程序启动,但其如何捆绑解决过去了,他们是如何相关的的onCreate被调用。任何人都可以尝试把这个简单易懂的英语,因为我似乎无法找到它很好的描述。I have been looking it up and I just cant seem...

我一直在寻找它,我只是不能似乎包裹自己周围的onCreate和捆绑。据我所知,程序启动,但其如何捆绑解决过去了,他们是如何相关的的onCreate被调用。任何人都可以尝试把这个简单易懂的英语,因为我似乎无法找到它很好的描述。

I have been looking it up and I just cant seem to wrap myself around the onCreate and Bundles. I understand that the onCreate is called when the program starts but its how the Bundles get passed around and how they are pertinent. Can anyone try to put this into plain english because I cant seem to find it well described.

感谢

推荐答案

捆绑的onCreate 方法应抱着你的活动状态就被杀死了。

The Bundle in the onCreate method should hold the state of you activity before it was killed.

简单的例子,当您更改设备的方向您的活动被重建。试想一下,在用户填写一个长形和他/她意外地改变了方向。当应用程序被重新启动进入将丢失所有数据,除非你坚持下去的信息。一种可能性是使用捆绑。

Simple example, when you change the orientation of your device your activity is recreated. Imagine the user is filling a long form and he/she accidentally changes the orientation. When the app gets restarted all data entered will be lost unless you persist that information. One possibility is using a Bundle.

如果你想知道如何使用它,我建议你读this问题。

If you want to know how to use it, I would recommend that you read this question.

阅读全文

相关推荐

最新文章