Could not understand how the app starts


#1

Hi there! Guys, I though a lot, but I still can’t understand, how the app starts. In AndroidManifest we wrote that the main activity is CrimeListActivity, which extends SingleFragmentActivity. However, how the OS knows where is onCreate() method, when it doesn’t exist in CrimeListActivity?


#2

The onCreate method exists for all Activities. It’s defined in the base Activity class that all activities subclass. So even if you don’t override it, onCreate still exists in a default form for all activities.


#3

As I understood. Firstly, app checks the main activity from AndroidManifest.xml. Then it goes to the superclass, because we don’t override CrimeListActivity.onCreate, and founds the exact onCreate in the SingleFragmentActivity. RIght?


#4

Yes. Correct. The only thing that I would change about your message is that it is Android that checks the AndroidManifest.xml to see which Activity to start (not the app).