可能是什么意图类型intent.setType(类型)? [英] What are the possible intent types for intent.setType(type)?

查看:697
本文介绍了可能是什么意图类型intent.setType(类型)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找如何从我的应用程序发送的电子邮件,我遇到了这个话题:

I was searching about how to send an email from my app and I came across this topic:

如何从我的Andr​​oid应用程序发送电子邮件

它解决了问题,添加类型为他的行为发送:

it solves the problem adding a type to his action send:

i.setType("message/rfc822");

这工作对我来说,我可以把我的电子邮件,它的伟大。我只是想知道我还有什么可以设置在那里。

That works for me too, I can send my email and it's great. I was just wondering what else I can set there.

我知道,如果我不设置任何东西,它会显示在列表中的所有可用的选项。我想强迫用户使用任何选择,我挑来分享。我可以探索这迫使用户以任何方式,我渴望分享?

I know that if i don't set anything it will show the list with all the options available. I want to force the user to share it using whatever option I pick. Can i explore this to force the user to share in whatever way I desire?

推荐答案

我觉得你不应该广播份额的意图时强制任何一种行为。

I think you aren't supposed to force any kind of behavior when broadcasting a share intent.

i.setType("message/rfc822"); 

该设置MIME类型你的意图的。我想,最好的,你就必须知道哪些MIME类型,你打算以使用共享内容(例如,Facebook的)答案的应用程序,并确保该应用程序是唯一的应用程序,将回答你的意图。

This sets the MIME type of your intent. I guess, at best, you would have to know which MIME type the app which you intend to use in order to share your content (ex. Facebook) answers, and assure that that app is the only app that will answer your intent.

这篇关于可能是什么意图类型intent.setType(类型)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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