tags:

views:

71

answers:

1
Notification notifyDetails = new Notification(R.drawable.msg,"message received",System.currentTimeMillis());
                    PendingIntent myIntent = PendingIntent.getActivity(context, 0, new Intent(Intent.ACTION_VIEW), 0);

I am using broadcast receiver to notify for incoming message. i am able to display my own notification in notification bar when message is received. i need when user clicks it it go to Inbox or currently received message.

PendingIntent myIntent = PendingIntent.getActivity(context, 0, new Intent(Intent.ACTION_VIEW, People.CONTENT_URI), 0);
//          notifyDetails.setLatestEventInfo(context, "Time has been Reset", "Click on me to view Contacts", myIntent);

like here when user click it goes to contacts in android. so what i pass in intent that when user clicks it goes to inbox.

+1  A: 

Answer from http://www.anddev.org/open_sms_activity-t6375.html:

        String SMS_MIME_TYPE = "vnd.android-dir/mms-sms";

        Intent defineIntent = new Intent(Intent.ACTION_MAIN);                

        defineIntent.setType(SMS_MIME_TYPE);                

        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0 , defineIntent, 0);
Sameer Segal
This technique is undocumented, unsupported, may not work on some current Android devices, may not work on future Android devices, and is not recommended.
CommonsWare
oh. just checked in my code working right now let see if another option is there.
ud_an