android tutorial - Start new activity in Android Intent - android studio - android app developement
Start new Activity
- This example explain how to use an Intent for start a new Activity.
You need two activities:
- CurrentActivity
- DestinationActivity
In CurrentActivity you have to created an Intent. For that you have to specify two arguments:
- Context: It's CurrentActivity, because Activity is a subclass of Context.
- DestinationActivity class
- Then, call startActivity passing the intent created.
- Now we have this source:
- For example, you can put it in a method an call it when an event ocurred.