如何通过Android应用程序在Google Plus中发布图片和链接网址?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了如何通过Android应用程序在Google Plus中发布图片和链接网址?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1337字,纯文字阅读大概需要2分钟。
内容图文
![如何通过Android应用程序在Google Plus中发布图片和链接网址?](/upload/InfoBanner/zyjiaocheng/678/9d366d19f04340528c3f87edc808b797.jpg)
我已经尝试过从服务器发布图像并从Google应用程序和Android应用程序中都链接URL.但是我不能同时在Google Plus中发布图像.
我已经尝试过发布此代码.
Intent shareIntent = new
PlusShare.Builder(GooglePlusActivity.this)
.setType("text/plain")
.setText("Welcome to the Google+ platform....")
.setContentDeepLinkId("/cheesecake/lemon",
"Lemon Cheesecake recipe",
"A tasty recipe for making lemon cheesecake.",
Uri.parse("http://www.onedigital.mx/ww3/wp-content/uploads/2012/02/android-420x315.jpg"))
.setContentUrl(Uri.parse("https://developers.google.com/+/"))
.getIntent();`
在此代码中,我仅发布了图片,未发布URL..显示URl,但不可点击.
有人给我解决我的问题的方法..
解决方法:
您需要google-play-services_lib库项目.只需将其导入添加到项目中的工作区中即可.
您可以在… / android-sdk-linux_x86 / extras / google / google_google_play_services / libproject中找到它
并使用此代码通过google-plus应用程序在google-plus上共享.
final int errorCode = GooglePlusUtil.checkGooglePlusApp(mActivity);
if (errorCode == GooglePlusUtil.SUCCESS) {
// Invoke the ACTION_SEND intent to share to Google+ with attribution.
Intent shareIntent = ShareCompat.IntentBuilder.from(mActivity)
.setText("")
.setType("text/plain")
.getIntent()
.setPackage("com.google.android.apps.plus");
startActivity(shareIntent);
} else {
Toast.makeText(mActivity, "Google plus not installed", Toast.LENGTH_LONG).show();
}
内容总结
以上是互联网集市为您收集整理的如何通过Android应用程序在Google Plus中发布图片和链接网址?全部内容,希望文章能够帮你解决如何通过Android应用程序在Google Plus中发布图片和链接网址?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。