There are some things I don't know about android activity lifecycle, don't get me started on fragments!:
Once a method like resume() is called will it proceed to be executed to the very end if finish() or startActivity(new Intent(..)) is called.
public void onResume(){
// do some stuff AAA
....
startActivity(new Intent(..));
// do some more stuff BBBB
// Do I get this far?
setResult(RESULT_CODE, intent);
finish();
// How about here? Do I get this far?
// how do I make sure that everything started in this app up to now is finished off as well? ie that activities started up by this activity are also finished?
}
Btw, this is a similar to top interview question. Will onPause() still get called after finish()? how about onStop()?
Lastly, I would like to know how to finish() not just the MainActivity but all such activities that have started under the application, ie started by MainActivivity, thus going back to the application that originally called my application.