Android的意图过滤器:添加附件,以SMS / MMS消息 [英] Android intent filter: add attachment to SMS/MMS message

查看:175
本文介绍了Android的意图过滤器:添加附件,以SMS / MMS消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户试图将附件添加到SMS / MMS消息什么意图解雇?我想这和他们没有工作:

What intent is fired when the user tries to add an attachment to an SMS/MMS message? I tried these and none of them work:

GET_CONTENT与DEFAULT类别和 / 的mime类型
与DEFAULT分类选择和 / 的mime类型

GET_CONTENT with DEFAULT category and "/" mimeType PICK with DEFAULT category and "/" mimeType

我也试过以上类别可打开和浏览。

I also tried the above with categories OPENABLE and BROWSABLE.

我找不到这个记录任何地方。它似乎并不相同意向的电子邮件附件过滤器。

I can't find this documented ANYWHERE. It doesn't seem to be the same intent as the email attachment filter.

只是为了澄清,我说的是增加我的应用程序当用户尝试的东西附加到SMS或MMS消息在出现的对话框中的选项。

Just to clarify, I'm talking about adding my app as an option in the dialog that appears when the user tries to attach something to an SMS or MMS message.

推荐答案

通常情况下用户这样对图片添加到彩信:

Normally user do this to add picture to MMS:

Intent sendIntent = new Intent(Intent.ACTION_SEND); 
sendIntent.putExtra("sms_body", "some text"); 
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
sendIntent.setType("image/png");

所以,你应该注册你的 ACTION_SEND 活动的 操作

您还可以过滤对具有通过哑剧=图像/ PNG过滤器附加的图像意向:

You can also filter on intents that have image attached via mime="image/png" filter:

<intent-filter android:icon="drawable resource"
           android:label="string resource"
           android:priority="integer" >
    <action android:name="ACTION_SEND" />
    <data android:mimeType="image/png"/>
</intent-filter>

更新:

要看到彩信应用如何添加附件,请参阅本code:<一href=\"http://www.google.com/$c$csearch#cZwlSNS7aEw/packages/apps/Mms/src/com/android/mms/ui/ComposeMessageActivity.java&exact_package=android&q=AttachmentTypeSelectorAdapter&type=cs&l=2415\" rel=\"nofollow\">http://www.google.com/$c$csearch#cZwlSNS7aEw/packages/apps/Mms/src/com/android/mms/ui/ComposeMessageActivity.java&exact_package=android&q=AttachmentTypeSelectorAdapter&type=cs&l=2415

To see how MMS app adds attachments see this code: http://www.google.com/codesearch#cZwlSNS7aEw/packages/apps/Mms/src/com/android/mms/ui/ComposeMessageActivity.java&exact_package=android&q=AttachmentTypeSelectorAdapter&type=cs&l=2415

在大多数情况下,你的应用需要注册 ACTION_GET_CONTENT 行动。

In most cases your app needs to register ACTION_GET_CONTENT action.

这篇关于Android的意图过滤器:添加附件,以SMS / MMS消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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