设置可见活动未定义

8
自从升级到Android SDK API 19(KitKat)后,我在构建项目时遇到以下错误:
The method setVisibleActivities(String, String) is undefined for the type PlusClient.Builder
如果我查看这个问题,它有一个链接指向API文档,其中似乎记录了此函数-但是它似乎也已经从那里消失了。
以下是相关代码:
PlusClient mPlusClient = new PlusClient.Builder(this, this, this) .setVisibleActivities("http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity") .build();
2个回答

27

我通过替换来修复了这个问题

PlusClient mPlusClient =
    new PlusClient.Builder(this, this, this).setVisibleActivities(
        "http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity")
        .build();

PlusClient mPlusClient =
    new PlusClient.Builder(this, this, this).setActions(
        "http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity")
        .setScopes("PLUS_LOGIN") // Space separated list of scopes
        .build();

现在应该已经解决了错误。

您可以在此处找到更多信息:https://developers.google.com/+/mobile/android/getting-started#step_4_initialize_the_plusclient


这行代码实际上在做什么?能否详细说明一下? - Abhishek Kaushik

0
我刚刚在尝试构建一个项目时遇到了这个问题。显然它需要Google Play服务for Froyo库而不是普通的库。这并不清楚,因为在project.properties文件中它们都被称为google-play-services_lib

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接