Android Basics – What is an Intent and how is it used to call an Activity ?

In Android App you can have multiple Activities. Each Activity performs a certain task. At times it needs to call another Activity.

To do this Intent is used. Which means an intent to do something.

To call a new MessageActivity from the MainActivity – on click of a Button add the following two lines in your MainActivity

Intent intent=new Intent(this, MessageActivity.class);

That’s it !