首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Google+中共享

在Google+中共享
EN

Stack Overflow用户
提问于 2012-08-09 19:49:59
回答 2查看 1K关注 0票数 2

我需要从安卓应用程序在Google+共享链接。在文档中,我看到了以下代码:

代码语言:javascript
复制
Button shareButton = (Button) findViewById(R.id.share_button);
shareButton.setOnClickListener(new OnClickListener() 
{
    @Override
    public void onClick(View v) 
    {
       // Launch the Google+ share dialog with attribution.
        Intent shareIntent = ShareCompat.IntentBuilder.from(ExampleActivity.this)
           .setType("text/plain")
           .setText("Welcome to the Google+ platform. https://developers.google.com/+")
           .getIntent()
           .setPackage("com.google.android.apps.plus");

        startActivity(shareIntent);
    } 
});

但如果在我的手机上是官方客户端Google+,它就可以工作。我可以在没有使用官方客户端的情况下在Google+中共享链接。

EN

回答 2

Stack Overflow用户

发布于 2012-08-09 21:54:51

Google+接口不支持共享。链接:https://developers.google.com/apis-explorer/#s/plus/v1/

票数 0
EN

Stack Overflow用户

发布于 2012-08-11 07:04:27

共享意图,显示在您提供的代码中。使用本机Google+应用程序向Google+共享内容。这是在Android上分享内容到Google+的唯一途径。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11882775

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档