Im making an app/game in android studio. And I have over 10 activities in my app/game and I have f.eks "int HP" I want to share with the others activities.
Asked
Active
Viewed 400 times
-3
-
some more code would be helpful – davejal Jan 07 '16 at 11:23
-
Question is not clear. add more about problem – ρяσѕρєя K Jan 07 '16 at 11:24
-
Take a look at the Intent class. – Araw Jan 07 '16 at 11:26
-
You can use shared preference to share your data. http://stackoverflow.com/questions/22138389/using-shared-preferences-in-between-activities – Suhas Palkar Jan 07 '16 at 11:29
1 Answers
1
Follwing way:
Intent intent = new Intent(Activity1.this,Activity2.class)
intent.putExtra("message", message);
startActivity(intent);
for more understanding go through this link
http://javatechig.com/android/pass-a-data-from-one-activity-to-another-in-android

nikk
- 407
- 3
- 7