Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why PLAY_SERVICES_RESOLUTION_REQUEST is 9000

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?

like image 738
Juan Carlos Piñeros Avatar asked Aug 06 '14 01:08

Juan Carlos Piñeros


2 Answers

Yes, it can be any number - as long as it is unique to that activity.

like image 181
ianhanniballake Avatar answered Oct 21 '22 06:10

ianhanniballake


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.

like image 9
Simon Avatar answered Oct 21 '22 04:10

Simon