When implementing a GCM Client, I found we use this constant:
PLAY_SERVICES_RESOLUTION_REQUEST is 9000
I'm new to programming, and maybe this is obvious, but I couldn't find information about it. Is this just a random number? Could I use other number?
Yes, it can be any number - as long as it is unique to that activity.
Please see the following:
Link to Google documentation...
It appears that the 9000 is the requestCode for startActivityForResult()
.
Once the startActivityForResult()
finishes, it passes its result to the onActivityResult()
and since you can have many startActivityForResult()
running at the same time, it becomes necessary for onActivityResult()
to identify which startActivityForResult
generated that result.
The 9000 is passed into a built-in android startActivityForResult()
and subsequently the onActivityResult()
method in the GooglePlayServicesUtil
class so we cannot see the 9000 being passed around but that is basically how it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With