I was at Red Rock Coffee, and found an Informal Android Developers Meetup. Met a nice guy who noodles with Android. And he found a glitch on the following page for Google’s Android APIs.
See the following code?
public class MyActivity extends Activity
public void onStart()
The nice guy believes that onStart() really ought to be to be onCreate(). Off the tope of my head, I am inclined to agree. onCreate is when you create an object, onStart is when you start it. Like in the diagram on this page (you have to scroll down a bit to see it).
From what I glean at the Google books webiste, you use onCreate() to create an activity, (I’d say instantiate it), while you call onStart() when the process is just being launched, or it was hidden, or when the service is started via startService(). onCreate() to create it, onStart() to start it up. That makes more sense to me, a tech writer learning Android.
- Go to the Google book website at http://books.google.com/
- Then Search Books for “Beginning Android 2 By Mark Murphy”.
- Then Search in this book for “onCreate onStart”.
Credit where credit is due. The nice guys’s website: