Created
October 26, 2013 19:30
-
-
Save tony1223/7173555 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(_context); | |
new AsyncTask<GoogleCloudMessaging, Void, String>() { | |
@Override | |
protected String doInBackground(GoogleCloudMessaging... params) { | |
String msg = ""; | |
try { | |
GoogleCloudMessaging message = params[0]; | |
String regid = message.register(GOOGLE_SENDER_ID); | |
sendGCMIDToServer(regid); | |
} catch (IOException ex) { | |
msg = "Error :" + ex.getMessage(); | |
} | |
return msg; | |
} | |
}.execute(gcm, null, null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment