如何共享捕获的照片使用添加一个简单的共享操作在android



我在我的应用程序中进行照片共享。对于正在使用"添加轻松共享操作"的应用程序,它只在操作栏中显示图标,而不显示选项。所以请给我举一些例子。

http://developer.android.com/training/sharing/shareaction.html

Easy Share正在自动填充;您只需要告诉ShareActionProvider您将要共享的内容。

大部分内容在您提供的API链接中共享,但如果您的目标是填充要共享的图像的列表,则需要包含此内容。

  Intent shareIntent = new Intent(Intent.ACTION_SEND);
  shareIntent.setType("image/*");
  Uri uri = Uri.fromFile(new File(getFilesDir(), "foo.jpg"));
  shareIntent.putExtra(Intent.EXTRA_STREAM, uri.toString());

既然shareIntent已设置为image,它将在列表中填充相关应用程序,如instagram、facebook或PhotoShop。

当您调用shareIntent.setType.

时,应用程序将以MIME类型(多用途Internet邮件扩展)的形式查看图像

最新更新