Java 仅通过特定应用共享我的应用

Java 仅通过特定应用共享我的应用,java,android,eclipse,facebook,share,Java,Android,Eclipse,Facebook,Share,我只想通过一些应用程序创建一个共享按钮。 现在我正在使用以下代码: Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_SUBJECT, "App Name"); intent.putExtra(Intent.EXTRA_TEXT, "Check out this cool app http://market.android.com/

我只想通过一些应用程序创建一个共享按钮。 现在我正在使用以下代码:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");

intent.putExtra(Intent.EXTRA_SUBJECT, "App Name");
intent.putExtra(Intent.EXTRA_TEXT, "Check out this cool app http://market.android.com/details?id=com.example.yourpackagename");

Intent chooser = Intent.createChooser(intent, "Tell a friend about App Name");
startActivity(chooser);
但它打开了一个巨大的窗口,所有的应用程序都安装在设备上。我只想显示选定的选项(Facebook、Whatsapp、Gmail)。
谢谢你。

看看这个答案,我建议你用它:

其他一些变通方法/解决方案: