Skip to content

Instantly share code, notes, and snippets.

@fnzainal
Created February 12, 2016 13:40
Show Gist options
  • Save fnzainal/2de4d41e8d356ad3b931 to your computer and use it in GitHub Desktop.
Save fnzainal/2de4d41e8d356ad3b931 to your computer and use it in GitHub Desktop.
Passing Values Between Activities with Bundle
//on first activity
Intent intent = new Intent(First.this,Second.class);
intent.putExtra("string_id",str_id);
startActivity(intent);
//on second activity
Bundle bundle = getIntent().getExtras();
if (bundle!=null){
str_nama = bundle.getString("string_id");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment