How to connect two activities in Android?

Define onClick attribute of button with function to be called as value of the attribute.

android:onClick = login

 where login is the name of function that is called when button is clicked.

 Now define Intent object inside this login() function.

Intent myIntent = new Intent( this, DashBoard.class);

 You need to add second activity name in AndroidManifest.xml file to make operating system know about the existence of second activity.


This is step that we usually forget to do. So keep in mind.


About Priyanka Kapoor

Simple, Hardworking & friendly.....
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s