[英]Share image to Google+ in Android app?
I'm working on a project that needs share image from my app to Google+. 我正在开发一个项目,需要从我的应用程序分享图像到Google+。 But when find out some samples relating to my problems, they requires installed Google+ from Google Play for sharing anything.
但是,当找到与我的问题相关的一些示例时,他们需要从Google Play安装Google+才能分享任何内容。 So the question is : How can I share from my app without installing any extra app?
所以问题是:如何在不安装任何额外应用程序的情况下从我的应用程序共享? Or install Google+ from Google Play is the only way to solve my problem?
或者从Google Play安装Google+是解决我问题的唯一方法吗?
Thank you for your attention! 感谢您的关注!
Hope May this help you... 希望这可以帮助你......
File tmpFile = new File("/path/to/image");
final String photoUri = MediaStore.Images.Media.insertImage(
getContentResolver(), tmpFile.getAbsolutePath(), null, null);
Intent shareIntent = ShareCompat.IntentBuilder.from(this)
.setText("Hello from Google+!")
.setType("image/jpeg")
.setStream(Uri.parse(photoUri))
.getIntent()
.setPackage("com.google.android.apps.plus");
The Google+ app only supports content:// URIs. Google+应用仅支持内容:// URI。 You will need to use the
MediaStore
API for this... 您将需要使用
MediaStore
API ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.