如何在Android的定制份额意图是什么?意图、份额、如何在、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.pu...

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

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.

阅读全文

相关推荐

最新文章