Created
March 21, 2016 02:37
-
-
Save SemonCat/e09262a1aed367eca8e2 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
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
InstanceID instanceID = InstanceID.getInstance(getApplicationContext()); | |
final String token = instanceID.getToken(getApplicationContext().getString(com.asus.robotrtcsdk.R.string.gcm_defaultSenderId), | |
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null); | |
runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
Toast.makeText(getApplicationContext(), token, Toast.LENGTH_LONG).show(); | |
} | |
}); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
}).start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment