如何岗位图像和链接URL从Android应用程序谷歌加? [英] How post Image and Link URL in Google Plus from Android Application?

查看:159
本文介绍了如何岗位图像和链接URL从Android应用程序谷歌加?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试从无论是在谷歌加上Android应用程序服务器和链接的URL后的图像..但我不能发布无论是在谷歌加..

i have try to post Image from server and link URL both in google plus from android application.. but i can't post both in google plus..

我有尝试这个code张贴..

i have try this code to post..

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();`

在tthis code我只张贴图片,但没有张贴网址.. URL被显示,但不能点击。

In tthis code i have only post a image but not post URL.. URl is display but it not clickable.

有人给我解决我的问题。

some one give me solution for my problem..

推荐答案

您需要的Google Play-services_lib 库项目。只需将其导入工作区在你的项目中添加。

You need google-play-services_lib library project. Just import it in workspace in add in your project.

您可以找到它的 ... / Android的SDK-linux_x86 /演员/谷歌/ google_play_services / libproject

和使用code为加谷歌通过谷歌,以及应用上的共享。

And use this code for sharing on google-plus via google-plus application.

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();
}

这篇关于如何岗位图像和链接URL从Android应用程序谷歌加?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆