Reputation: 36664
I'm trying to run this following line
credential = GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE);
and get this error:
The method usingOAuth2(Context, Collection<String>) in the type GoogleAccountCredential is not applicable for the arguments (GoogleDriveProxeyActivity, String)
I then changed the code to this:
credential = GoogleAccountCredential.usingOAuth2(this, Arrays.asList(DriveScopes.DRIVE.split(",")));
but is there a simpler\neater way to send the proper type of param?
Upvotes: 2
Views: 1065
Reputation: 33083
The values of all the string constants in DriveScopes (in the current version of the API!) are single scope keys, not comma-separated lists. So, you should create any suitable collection - this is a nice way to create a collection of size 1 in Java:
Collections.singleton(DriveScopes.DRIVE)
Upvotes: 3