How to display android sms inbox
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 开发者_C百科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.
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);
精彩评论