If I have two activities A and B. And I create an intent that initiates activity B from the onCreate() of activity A, when will the onStart() of activity A be called?
For example, let us say I had the following:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent(this, B.class);
startActivityForResult(intent, REQUEST_CONNECT_DEVICE);
}
Will the onStart() method of that activity be called as soon as these lines of code finish executing or will it create activity B first?
Basic Android Activity Life Cycle
When App opened : onCreated() > onStart() > onResume()
When App close : onPause()
Here in your case below is the work flow
Action 1: Activity A opened
Action 2: Activity B started
onPause() of Activity A called
onCreate() of Activity B called