Sharing an image with Google+ app using Intent.ACTION_SEND and Intent.EXTRA_STREAM

后端 未结 3 1077
借酒劲吻你
借酒劲吻你 2020-12-13 07:51

My app generates images that a user can save or share with others. The code below works for most apps: Messenger, Facebook, Dropbox, email, etc. Meaning, the image is load

3条回答
  •  失恋的感觉
    2020-12-13 08:11

    Thanks for raising this question!

    Yes it seems that Google+ only accepts media from content providers (content:// uris), not file:// uris. So we need to put the image into MediaStore first. An easier way to do this is:

    MediaStore.Images.Media.insertImage(context.getContentResolver(), tmpFile.getAbsolutePath(), tmpFile.getName(), null);
    

提交回复
热议问题