Reputation: 33
I'm trying to run some Google Drive sample code from the Android Developers website but I'm getting a number of instances where Android Studio cannot resolve method. I think most of the problem might be attributed to BaseDemoActivity also not being recognized. I've gone through the setup process to make sure I have everything correct and as far as I can see it is, I even just this morning updated my Google Play Services version in case it was that but still nothing. Can someone point me in the right direction of how I might fix this?
/**
* An activity to illustrate how to create a new folder.
*/
public class CreateFolderActivity extends BaseDemoActivity {
@Override
public void onConnected(Bundle connectionHint) {
super.onConnected(connectionHint);
MetadataChangeSet changeSet = new MetadataChangeSet.Builder()
.setTitle("New folder").build();
Drive.DriveApi.getRootFolder(getGoogleApiClient()).createFolder(
getGoogleApiClient(), changeSet).addResultCallback(folderCreatedCallback);
}
ResultCallback<DriveFolderResult> folderCreatedCallback = new
ResultCallback<DriveFolderResult>() {
@Override
public void onResult(DriveFolderResult result) {
if (!result.getStatus().isSuccess()) {
showMessage("Error while trying to create the folder");
return;
}
showMessage("Created a folder: " + result.getDriveFolder().getDriveId());
}
}
}
Upvotes: 0
Views: 671
Reputation: 46844
BaseDemoActivity is not part of the API, its just used in the samples. Make sure you have that class copied into your app from the sample.
Upvotes: 1