I am looking for all the ways one can call another activity from an activity within the application programmatically. The one I currently know is creating a new intent, and call start intent with required activity class. Are there any other ways?
Thanks
This is indeed the standard model for Activity control.
startActivity(Intent)is a method from the Context class, which Activity subclasses.One important distinction is between
startActivity(Intent)andstartActivityForResult(Intent, int). You’ll usestartActivityForResult(Intent, int)if you’re looking to get some result from the new Activity. The secondintargument allows you to distinguish between multiple activities returning results (i.e., if you could potentially launch more than one sub-Activity from a given Activity). This is handled in anonActivityResult(Intent, int, options)method, which you can read all about here. In general, the Activity doc is one you should be familiar with if you’re doing a lot of Android programming, because the Activity lifecycle is important and can be tricky.