本文整理汇总了Java中com.google.android.gms.drive.OpenFileActivityBuilder类的典型用法代码示例。如果您正苦于以下问题:Java OpenFileActivityBuilder类的具体用法?Java OpenFileActivityBuilder怎么用?Java OpenFileActivityBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OpenFileActivityBuilder类属于com.google.android.gms.drive包,在下文中一共展示了OpenFileActivityBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case RESOLVE_CONNECTION_REQUEST_CODE:
if (resultCode == RESULT_OK) {
mGoogleApiClient.connect();
}
break;
case 120:
DriveId driveId = data.getParcelableExtra(OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
new ReadWriteAsync(driveId).execute();
break;
}
}
示例2: showGDriveFolderSelector
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
private static void showGDriveFolderSelector(Activity activity) {
if (activity == null)
return;
OpenFileActivityBuilder openFileActivityBuilder = Drive.DriveApi
.newOpenFileActivityBuilder();
if (openFileActivityBuilder != null) {
IntentSender intentSender = openFileActivityBuilder.setActivityTitle(AndiCar.getAppResources().getString(R.string.pref_secure_backup_gdrive_folder_selector_title))
.setSelectionFilter(Filters.eq(SearchableField.MIME_TYPE, DriveFolder.MIME_TYPE))
.build(mGoogleApiClient);
try {
activity.startIntentSenderForResult(
intentSender, ConstantValues.REQUEST_OPEN_DRIVE_FOLDER, null, 0, 0, 0);
}
catch (IntentSender.SendIntentException e) {
Log.i("AndiCar", "Failed to launch file chooser.");
}
}
else {
Toast.makeText(activity, "Unable to open folder selector!", Toast.LENGTH_LONG).show();
}
}
示例3: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case AppConstants.EXPORT_RESOLVE_CONNECTION_REQUEST_CODE:
if (resultCode == RESULT_OK) {
mGoogleApiClient.connect();
}
break;
case AppConstants.EXPORT_CREATOR_REQUEST_CODE:
if (resultCode == RESULT_OK) {
DriveId driveFileId = (DriveId) data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
writeDataExportToFile(driveFileId);
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例4: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case AppConstants.EXPORT_RESOLVE_CONNECTION_REQUEST_CODE:
if (resultCode == RESULT_OK) {
// mGoogleApiClient.connect();
}
break;
case AppConstants.EXPORT_CREATOR_REQUEST_CODE:
if (resultCode == RESULT_OK) {
DriveId driveFileId = (DriveId) data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
writeDataExportToFile(driveFileId);
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例5: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
switch (requestCode) {
case REQUEST_CODE_CREATOR:
// Called after a file is saved to Drive.
if (resultCode == RESULT_OK) {
Log.i(TAG, "Backup successfully saved.");
Toast.makeText(this, "Backup successufly loaded!", Toast.LENGTH_SHORT).show();
}
break;
case REQUEST_CODE_OPENER:
if (resultCode == RESULT_OK) {
DriveId driveId = data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
//Toast.makeText(this, driveId.toString(), Toast.LENGTH_SHORT).show();
DriveFile file = driveId.asDriveFile();
importFromDrive(file);
}
}
}
示例6: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_OPEN:
if (resultCode == RESULT_OK) {
Log.d("DocumentList", "In Open activity result");
DriveId driveId = data.getParcelableExtra(OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
Intent intent = new Intent(this, TextEditor.class);
intent.putExtra(TextEditor.INTENT_DRIVE_ID, driveId);
this.startActivity(intent);
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
}
}
示例7: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_GDRIVE_PICKER:
//User has picked a file from Google Drive
if (resultCode == Activity.RESULT_OK && data != null) {
DriveId driveId = data.getParcelableExtra(OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
Log.d(TAG, "Selected file's ID: " + driveId);
//Download the file in background thread
new FetchBackUpFromGDriveAsync(getActivity(), getGoogleApiClient(), this).execute(driveId);
} else {
// show failed error message
showEndResultToUser(String.format(getString(R.string.msg_importing), getString(R.string.str_failed)), false);
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例8: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (resultCode == Activity.RESULT_CANCELED)
dismissProgressDialog();
switch (requestCode)
{
case REQUEST_RESOLVE_ERROR:
if (resultCode == Activity.RESULT_OK)
connectClient();
return;
case REQUEST_FILE:
if (resultCode == RESULT_OK)
{
DriveId driveId = data.getParcelableExtra(OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
doRestore = false;
new RestoreAsyncTask(client).execute(driveId);
}
return;
}
super.onActivityResult(requestCode, resultCode, data);
}
示例9: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch(requestCode) {
case REQUEST_CODE_OPENER:
if (resultCode == RESULT_OK) {
DriveId driveId = (DriveId) data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
showMessage("Selected folder's ID: " + driveId);
}
finish();
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例10: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_CREATOR:
if (resultCode == RESULT_OK) {
DriveId driveId = (DriveId) data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
showMessage("File created with ID: " + driveId);
}
finish();
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例11: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
/**
* Handles response from the file picker.
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_OPENER:
if (resultCode == RESULT_OK) {
mFileId = (DriveId) data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
} else {
finish();
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
}
}
示例12: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
/**
* Handles response from file picker.
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_OPENER:
if (resultCode == RESULT_OK) {
mSelectedFileId = (DriveId) data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
refresh();
} else {
finish();
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
}
}
示例13: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case RESOLVE_CONNECTION_REQUEST_CODE:
if (resultCode == RESULT_OK) {
mGoogleApiClient.connect();
}
break;
case REQUEST_CODE_SELECT_FILE:
case REQUEST_CODE_NEW_FILE:
if (resultCode == RESULT_OK) {
mDriveId = data.getParcelableExtra(OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
Log.d(TAG, "driveId: " + mDriveId.encodeToString());
SharedPreferences.Editor editor = getPreferences(Context.MODE_PRIVATE).edit();
editor.putString(DRIVE_ID_FILE, mDriveId.encodeToString());
editor.commit();
mTvStatus2.setText("GDrive Client - Connected - File Selected");
mBtSync.setEnabled(true);
mBtResetLastSyncTimestamp.setEnabled(true);
readMetadata();
if (dbSync != null) {
dbSync.dispose();
}
onPostSelectFile();
}
break;
}
}
示例14: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CODE_OPENER && resultCode == RESULT_OK) {
mSelectedFileDriveId = (DriveId) data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:10,代码来源:RetrieveContentsWithProgressDialogActivity.java
示例15: onActivityResult
import com.google.android.gms.drive.OpenFileActivityBuilder; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_OPENER:
if (resultCode == RESULT_OK) {
DriveId driveId = (DriveId) data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
showMessage("Selected file's ID: " + driveId);
}
finish();
break;
default:
super.onActivityResult(requestCode, resultCode, data);
}
}