Q:

Gcm Notification data in activity

I am using GCM Notification , i have done every setting regarding to receive the data , Gcm Notification is coming but when I click on the notification ,   it open but I got null in the intent.
My chatscreenctivity
    protected void onCreate(Bundle savedInstanceState)
     {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.chatscreenctivity);
        Intent intent=getIntent();
        registerReceiver(mHandleMessageReceiver, new IntentFilter(
                DISPLAY_MESSAGE_ACTION));
        String message = intent.getExtras().getString("broadmessage");  **//Hre i got Null**
        String sender_image=intent.getExtras().getString("sender_image");**//Hre i got Null**
        String sender_Name=intent.getExtras().getString("sender_name");
        mlistview=(ListView)findViewById(R.id.listview1);
        sendmessage=(ImageView)findViewById(R.id.sendmeassage);
        sentext=(EditText)findViewById(R.id.et_sent_msg);
        getActionBar().setTitle(sender_Name);
        getActionBar().setHomeButtonEnabled(true);
        getActionBar().setDisplayHomeAsUpEnabled(true);
}

   Hre i got the value from gcm
         @Override
            protected void onMessage(Context context, Intent intent) {
                Log.i(TAG, "Received message");
                String Message ="",image="",sendername="";
                String Broadscast = intent.getExtras().getString("message");
                if(Broadscast.equals("You have got login points!"))
                {
                    Message=Broadscast;
                    generateNotification(context, Message);
                }
                else
                {
                    try
                    {
                    JSONObject json=new JSONObject(Broadscast);
                    Message=json.getString("message");
                    image=json.getString("image");
                    sendername=json.getString("firstname")+" "+json.getString("lastname");

                    }
                    catch(JSONException e)
                    {

                    }
                    generateNotification(context, Broadscast);
                }
                displayMessage(context, Message);
                // notifies user

            }

Here is my custom notification and i am passing the value
 Intent notificationIntent = new Intent(context, SlidingMenuActivity.class);
        // set intent so it does not start a new activity
        notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
                Intent.FLAG_ACTIVITY_SINGLE_TOP);
        PendingIntent intent =
                PendingIntent.getActivity(context, 0, notificationIntent, 0);
        notification.contentIntent=intent;

        notification.flags |= Notification.FLAG_AUTO_CANCEL;

        // Play default notification sound
        notification.defaults |= Notification.DEFAULT_SOUND;

        //notification.sound = Uri.parse("android.resource://" + context.getPackageName() + "your_sound_file_name.mp3");

        // Vibrate if vibrate is enabled
        notification.defaults |= Notification.DEFAULT_VIBRATE;
        notificationManager.notify(0, notification); 

here is diaplaymessage in common utilites
   static void displayMessage(Context context, String message) {
        Intent intent = new Intent(DISPLAY_MESSAGE_ACTION);
        intent.putExtra("broadmessage", message);
       intent.putExtra("sender_image", "fdgdfg");
        context.sendBroadcast(intent);
    }

A:

Set Intent data in your notificationIntent like this
 Intent notificationIntent = new Intent(context, SlidingMenuActivity.class);
    // set intent so it does not start a new activity
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
            Intent.FLAG_ACTIVITY_SINGLE_TOP);
    notificationIntent.putExtra("broadmessage", message);
    notificationIntent.putExtra("sender_image", "fdgdfg");
    PendingIntent intent =
            PendingIntent.getActivity(context, 0, notificationIntent, 0);
    notification.contentIntent=intent;

    notification.flags |= Notification.FLAG_AUTO_CANCEL;

    // Play default notification sound
    notification.defaults |= Notification.DEFAULT_SOUND;

    //notification.sound = Uri.parse("android.resource://" + context.getPackageName() + "your_sound_file_name.mp3");

    // Vibrate if vibrate is enabled
    notification.defaults |= Notification.DEFAULT_VIBRATE;
    notificationManager.notify(0, notification); 

