-2

Is it possible for users to receive points in one Activity, and those points show up in another activity? If so, could someone give me a detailed explanation on how to do so?

3 Answers3

2

I'm pretty sure what you want is to use an intent, pass data (in this case, an integer value for the "score") into the intent, and finally start the second activity from the first activity using the intent. After that, the second activity can read the "score" data passed through from the intent.

How do I pass data between Activities in Android application?

Look at the answer(s) in the above link.

Community
  • 1
  • 1
Cherry
  • 143
  • 10
1

I suggest you take a look at startActivityForResult. Here's the reference to android documentation:

http://developer.android.com/training/basics/intents/result.html

That way you could pass your "score" (I guess it's an integer) to the second activity, do some modification to it and catch it back in onActivityResult from the first activity.

Shinnyx
  • 1,814
  • 2
  • 12
  • 21
0

How difficult is this, there are mulitple options to do this, one of them is to make the variable static in the first activity and then call it from another activity.

androidStud
  • 414
  • 3
  • 9