Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent intent = new Intent(context, ActivityB.class);
- intent.putExtra("my_value", 2); //2 is the value you want to pass
- startActivity(intent);
- int variable = getIntent().getIntExtra("my_value", 0);//0 is the default value if the getintExtra doesn't find the "my_value"
- Intent intent = new Intent(ActivityA.this,
- ActivityB.class);
- intent.putExtra("myInt", myInt);
- getIntent().getIntExtra("myInt");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement