Skip to content Skip to sidebar Skip to footer

The Gcm Notification Message From The Notification Bar Will Not Be Shown In The Activity If The App Isn't Started Already

I am using this tutorial for push notifications http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/ It works fine but whe

Solution 1:

Update the TextView after you initialize it

lblMessage = (TextView) findViewById(R.id.lblMessage);

As you are making notification and putting the value with the key "message", so you need to retrieve the value though the same key "message"

lblMessage.append("New Message: "+ i.getStringExtra("message") + "\n"); 

Solution 2:

txtMessage = (TextView) findViewById(R.id.txt_push_message);
Stringmessage= intent.getStringExtra("message");
Toast.makeText(getApplicationContext(), "Push notification: " + message, Toast.LENGTH_LONG).show();
txtMessage.setText(message);

Post a Comment for "The Gcm Notification Message From The Notification Bar Will Not Be Shown In The Activity If The App Isn't Started Already"