Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setVisibleActivities undefined

Ever since upgrading to Android SDK API 19 (KitKat), I'm getting the following error when trying to build my project:

The method setVisibleActivities(String, String) is undefined for the type PlusClient.Builder

If I look at this question, it has a link to the API where apparently this function was documented - but it appears to have simply disappeared from there as well.

Here is the code in question:
PlusClient mPlusClient = new PlusClient.Builder(this, this, this) .setVisibleActivities("http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity") .build();

like image 332
14 revs, 12 users 16% Avatar asked Nov 10 '13 07:11

14 revs, 12 users 16%


1 Answers

I was able to fix this problem by replacing

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

with

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

Errors should be gone now.

You can find more about that here: https://developers.google.com/+/mobile/android/getting-started#step_4_initialize_the_plusclient

like image 115
Karim Avatar answered Oct 28 '22 13:10

Karim