How to display android sms inbox

﹥>﹥吖頭↗ 提交于 2019-12-12 01:29:33

问题


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:


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


来源:https://stackoverflow.com/questions/3608055/how-to-display-android-sms-inbox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!