从活动访问Android的收件箱/消息? [英] Accessing Android Inbox/Messaging from Activity?

查看:188
本文介绍了从活动访问Android的收件箱/消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能从你自己写一个活动里面打开默认的Andr​​oid邮件活动?例如像:我preSS我的计划内的邮件按钮,它会打开Android的消息应用程序,就像仿佛我是preSS的主屏幕上的图标消息

我没有与此类似与联系人活动的东西,但只有联系人列表中出现,没有额外的功能,如添加/修改/删除等。

任何想法?

编辑:我发现这种方式打开撰写新邮件的活动,我只是需要对其进行备份的一个步骤。有谁知道正确的MIME类型,而不是这一个?

 意图sendIntent =新的意图(Intent.ACTION_VIEW);
sendIntent.setType(vnd.android-DI​​R / MMS,SMS);
m_activity.startActivity(sendIntent);
 

解决方案

这将启动从另一个应用程序的消息应用程序:

 意向意图=新的意图(android.intent.action.MAIN);
intent.setComponent(新单元名(com.android.mms,com.android.mms.ui.ConversationList));
startActivity(意向);
 

只要把一个按钮,监听器,或者您想从打开任何用户输入进去。

享受: - )

Is it possible to open up the default Android Messaging activity from inside an activity you write yourself? Like for example: I press a "Mail" button inside my program, and it opens the Android Messaging app just like as if I was to press the Messaging icon on the main screen.

I did something similar to this with the Contacts activity, but only the contact list comes up, no extra functionality like Adding/Modifying/Deleting, etc.

Any ideas?

edit: I found this way to open the "Compose New Message" Activity, I just need to back it up a step. Does anyone know the correct MIME type instead of this one?

Intent sendIntent = new Intent(Intent.ACTION_VIEW); 
sendIntent.setType("vnd.android-dir/mms-sms"); 
m_activity.startActivity(sendIntent); 

解决方案

This starts the messaging app from another app:

Intent intent = new Intent("android.intent.action.MAIN");
intent.setComponent(new ComponentName("com.android.mms","com.android.mms.ui.ConversationList"));
startActivity(intent);

Just put it inside a button listener or whatever user input you want to open it from.

Enjoy :-)

这篇关于从活动访问Android的收件箱/消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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