I'd like to pass a layout ID (or any id) between 2 Android activities. Any help would be appreciated.
Asked
Active
Viewed 137 times
-2
-
http://stackoverflow.com/questions/4233873/how-do-i-get-extra-data-from-intent-on-android – litelite May 04 '17 at 19:21
-
just add the id as a int on the Intent and get it as a int in the another activity. – jmarkstar May 04 '17 at 19:24
1 Answers
0
Intent intent = new Intent(this, SecondActivity.class);
intent.putExtra("ID",10000);
startActivity(intent);
at SecondActivity.class
int ID = getIntent().getIntExtra("ID"); // getStringExtra("ID");

ZeroOne
- 8,996
- 4
- 27
- 45