如何在Android的定制份额意图是什么? [英] How to customize share intent in Android?

查看:118
本文介绍了如何在Android的定制份额意图是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我可以使用共享意图打开共享对话框

Now i can use the share intent to open the share dialog

    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_TEXT, link);  
    startActivity(Intent.createChooser(intent, "Share with"));

但我需要的对话框不会出现,直接共享给一个社交网络,例如(FB或Twitter)

but i need the dialog not to appear and share directly to one social network for example (FB or twitter)

任何建议如何做到这一点?

any advice how to do that ?

推荐答案

没有你不行。意向的都应该以这种方式工作。如果你有强制特定的应用程序来打开,用明确的意图,如果目标应用程序支持的。如果不知道包名或目标应用程序的组件名称或数据类型或MIME类型,你不能强迫一个特定的应用程序工作在广义的意图。

No you can't. Intent's are supposed to work this way. If you have to force a particular app to open, use explicit intents if the target apps support those. Without knowing the package names or the component names of the target apps, or the type or mime type of data, you can't force a particular app to work on generalized intents.

这篇关于如何在Android的定制份额意图是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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