How do you start activity "ViewMessageListActivity" when clicked on notification from status bar
<p>when I receive a sms, I see the notification of the sms in the status bar when I clicked on the sms notification from status bar, It does not open the ViewMessageListActivity (my conversation log). How do I open this activity.</p>

<pre><code>import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.gsm.SmsMessage;
import android.widget.Toast;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class SmsReceiver extends BroadcastReceiver {

static final String ACTION = "android.provider.Telephony.SMS_RECEIVED";
int notificationID = 1;

@Override
public void onReceive(Context context, Intent intent) 
{

       NotificationManager mNotificationManager = 
      (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
        if (intent.getAction().equals(ACTION)) {

            StringBuilder sb = new StringBuilder();
            String from = new String();
            String body = new String();

            Bundle bundle = intent.getExtras();
            if (bundle != null) {
                Object[] pdus = (Object[]) bundle.get("pdus");
                for (Object pdu : pdus){
                SmsMessage messages = SmsMessage.createFromPdu((byte[]) pdu);
                sb.append(messages.getDisplayOriginatingAddress());
                from = messages.getDisplayOriginatingAddress();
                sb.append(messages.getDisplayMessageBody());
                body= messages.getDisplayMessageBody();

                //Log.i(LOG_TAG, "[SMSApp] onReceiveIntent: " + sb);
                //abortBroadcast();
                }// end for
            }//end if

            int icon = R.drawable.stat_notify_sms;
            CharSequence tickerText = from + ": " + body;
            long when = System.currentTimeMillis();

            Notification notification = new Notification(icon, tickerText, when);
            CharSequence contentTitle = "New Cybernetx Secure Text Message";
            CharSequence contentText = from + " " + body;

            Intent notificationIntent = new Intent();
            PendingIntent contentIntent = 
            PendingIntent.getActivity(context, 0, notificationIntent, 0);

            notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
            notification.vibrate = new long[] { 100, 250, 100, 500};
            notification.flags |= Notification.FLAG_AUTO_CANCEL;
            mNotificationManager.notify(notificationID, notification);

            //    intent.setAction(SendReceiveService.RECEIVE_SMS_ACTION);
           //     intent.setClass(arg0, ViewMessageListActivity.class);
           //     intent.putExtra("notificationID", notificationID);
           //     arg0.startService(intent);


               // PendingIntent contentIntent =
               //     PendingIntent.getActivity(arg0, 0, i, 0);

            /* Start the Main-Activity */
            Intent i = new Intent(context, ViewMessageListActivity.class);
            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(i); 


        }//end if

   }
</code></pre>

<p>}</p>
