如何显示Android的短信收件箱 [英] How to display android sms inbox

查看:251
本文介绍了如何显示Android的短信收件箱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

喜欢这里,当用户点击它关系到Android通讯录。所以,我传递的意图,当用户点击它进入收件箱。

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.

推荐答案

这答案的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);

这篇关于如何显示Android的短信收件箱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆