Monday, July 9, 2012

startActivity(Intent) in Android

The startActivity(Intent) method is used to start a new activity, which will be placed at the top of the activity stack. It takes a single argument, an Intent, which describes the activity to be executed.

Intent intent = new Intent();
intent.setClass(MyActivity.this, NewActivity.class);
startActivity(intent);

No comments:

Post a Comment