ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

如何通过Android应用程序在Google Plus中发布图片和链接网址?

2019-10-30 14:35:56  阅读:223  来源: 互联网

标签:google-play-services google-plus android


我已经尝试过从服务器发布图像并从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();
}

标签:google-play-services,google-plus,android
来源: https://codeday.me/bug/20191030/1968577.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有