Android : When does Android system launches the intent in startActivityForResult?

on Tuesday, September 2, 2014


I want to know when exactly does the new activity gets launched (or when is the intent really sent by system). I created 2 activities for this purpose. On Activity1, I entered



Log.d("Test", "Activity 2 is about to be created");
startActivityForResult(getIntentForLaunchingActivity2(), 5);
Log.d("Test", "startActivityForResult for Activity2 has been called");


In Activity2's onCreate method I added the following debug statement.



Log.d("Test", "Started Activity 2");


I observed the following sequence of statements



Activity 2 is about to be created
startActivityForResult for Activity2 has been called
Started Activity 2


I want to know if there is any sequence. Is this sequence something Android system level detail or the API's contract? Pardon me if this is really trivial. I have just started in the Android world and wanted to gain more accurate information. Thanks for help in advance.


0 comments:

Post a Comment