Android 发送照片但过滤一些应用程序

Android 发送照片但过滤一些应用程序,android,android-intent,intentfilter,Android,Android Intent,Intentfilter,我使用下面的代码将照片发送到其他应用程序 Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("image/jpeg"); sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(FilePath)); startActivity(Intent.createChooser(sharingIntent, "Share via")); 但我想过滤

我使用下面的代码将照片发送到其他应用程序

Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("image/jpeg");
sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(FilePath));
startActivity(Intent.createChooser(sharingIntent, "Share via"));

但我想过滤一些应用程序。例如,我不想分享到Facebook。我知道它的软件包名是
com.facebook.katana
。在显示我可以共享照片的所有应用程序时,我如何进行筛选?

与此类似,您可以创建您的意图并使用querytentActivities()来代替。 它会给你一个应用程序列表,你必须从中手动筛选出一些你不想要的应用程序

但在此之后,您可能必须创建自己的对话框