*** Activity1
Intent myIntent = new Intent(getBaseContext(), Activity2.class);
myIntent.putExtra("data1","value1");
startActivity(myIntent);
*** Activity2
Bundle extras = getIntent().getExtras();
if (extras != null) {
String value = extras.getString("data1");
// Toast toast = Toast.makeText(Activity2.this, value, Toast.LENGTH_SHORT);
// toast.show();
}
댓글
댓글 쓰기