Skip to content

Instantly share code, notes, and snippets.

@benigumocom
Created August 24, 2012 17:21
Show Gist options
  • Save benigumocom/3453126 to your computer and use it in GitHub Desktop.
Save benigumocom/3453126 to your computer and use it in GitHub Desktop.
GCM 受信したメッセージを表示する
@Override
protected void onMessage(Context context, Intent intent) {
Log.i(TAG, "Received message");
// intent から取得して表示する文字列に結合
Bundle extras = intent.getExtras();
String result = extras.getString("message");
String message = getString(R.string.gcm_message) + " = " + result;
// show display and notification
displayMessage(context, message);
generateNotification(context, message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment