如何显示android sms收件箱

时间:2010-08-31 10:17:55

标签: android sms

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

我正在使用广播接收器来通知传入消息。收到消息后,我可以在通知栏中显示我自己的通知。我需要在用户点击它时转到收件箱或当前收到的消息。

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);

就像这里当用户点击它去到android中的联系人。所以我通过意图传递用户点击它进入收件箱。

1 个答案:

答案 0 :(得分:2)

来自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);