Android : DriveScopes cannot be resolved to a variable.

on Friday, December 12, 2014


i am facing the problem in Drive. I am unable to import it. please help me to resolve it thanks private ProgressBar progressBar; private Context context; private static Uri callLogFileUri; private static Uri smsLogFileUri; private static Drive service; private boolean callLogs; private boolean smsLogs; private String address; private ContentResolver cr; private GoogleAccountCredential credential;



@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.backup_layout);

progressBar = (ProgressBar) findViewById(R.id.progressBar);
progressBar.setVisibility(View.VISIBLE);

context = this;
Intent intent;
cr = getContentResolver();
credential = GoogleAccountCredential.usingOAuth2(this,DriveScopes.DRIVE);

try {
intent = getIntent();

if (intent.hasExtra("fromReceiver")) {
address = intent.getStringExtra("fromReceiver");
Log.i(TAG, "Backup intent from receiver");
recoverData();
} else {
Log.i(TAG, "Backup intent from elsewhere");
DialogFragment dialog = new BackupAccountsDialogFragment();
dialog.show(getFragmentManager(),
"BackupAccountsDialogFragment");
}

} catch(Exception e) {
recoverData();
}
}

@Override
protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
switch (requestCode) {
case REQUEST_ACCOUNT_PICKER:
if (resultCode == RESULT_OK && data != null && data.getExtras() != null) {
final String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);
if (accountName != null) {
Log.i(TAG, "REQUEST ACCOUNT PICKER");
credential.setSelectedAccountName(accountName);
service = getDriveService(credential);
storeGoogleAccounts(accountName);
Log.i(TAG, "Account saved: " + CHOSEN_GOOGLE_ACCOUNT + " " + accountName);
getFirstAuthInAsync();
}

0 comments:

Post a Comment