So I'm just starting out in android from a shaky background in Java. I mean I aced both Java programming classes, but that doesn't exactly produce a programmer. Just to explain where I'm at and what I'll understand.
At any rate, when an Android activity first starts onCreate(Bundle) is called and I don't really understand where this "bundle" gets sent from as a parameter or where it's used even. Any insight would be appreciated :)|||The bundle is set by the Android System when you application is created.
For any number of reasons, Android may decide to 'kill' you application, but may restart it again later. If your application is going to be killed, then the Android System will give you a chance to save the 'state' of your application. You will save the state of your application in a bundle provide to you at that time. Then on the onCreate, you can test to see if you have data in the bundle and restore your controls to the value(s) just before you were killed. If done correctly, then the user will not use any data that they were working on.
If you are starting out as a Android programmer, then for now, just leave it alone. Later, it will become clear when to use this.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment