Skip to content

Instantly share code, notes, and snippets.

@vvikramjhu
Created February 6, 2014 22:06
Show Gist options
  • Save vvikramjhu/8853435 to your computer and use it in GitHub Desktop.
Save vvikramjhu/8853435 to your computer and use it in GitHub Desktop.
Button launchActivityTwoButton = (Button) findViewById(R.id.bLaunchActivityTwo);
launchActivityTwoButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO:
// Launch Activity Two
// Hint: use Context's startActivity() method
// Create an intent stating which Activity you would like to start
try {
Intent startA2 = new Intent(this, ActivityTwo.class);
startActivity(startA2);
} catch (Exception e) {
// TODO: handle exception
Log.e(TAG, e.toString());
}
// Launch the Activity using the intent
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment