Last Updated: February 25, 2016
·
510
· jrmgx

Android Intents

Open an URL

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(browserIntent); 

Pass information thru activities

Intent intent = new Intent(ListActivity.this, ShowActivity.class);
intent.putExtra(EXTRA_USER_ID, userId);
startActivity(intent);

// and then
int userId = getIntent().getExtras().getInt(EXTRA_USER_ID);