当前位置: 首页>>代码示例>>Java>>正文


Java OpenFileActivityBuilder类代码示例

本文整理汇总了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;
    }
}
 
开发者ID:claudiodegio,项目名称:dbsync,代码行数:21,代码来源:TestGDriveActivity.java

示例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();
    }
}
 
开发者ID:mkeresztes,项目名称:AndiCar,代码行数:24,代码来源:PreferenceActivity.java

示例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;
    }
}
 
开发者ID:robertsimoes,项目名称:Flow,代码行数:22,代码来源:TheHubActivity.java

示例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;
        }
    }
 
开发者ID:tortuvshin,项目名称:yield,代码行数:22,代码来源:TheHubActivity.java

示例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);
            }
    }
}
 
开发者ID:prof18,项目名称:Database-Backup-Restore,代码行数:23,代码来源:MainActivity.java

示例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);
    }
}
 
开发者ID:rkkr,项目名称:drive-notepad,代码行数:17,代码来源:DocumentList.java

示例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;
    }
}
 
开发者ID:ndhunju,项目名称:dailyJournal,代码行数:21,代码来源:GoogleDriveRestoreBackupActivity.java

示例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);
}
 
开发者ID:kimkha,项目名称:Finanvita,代码行数:26,代码来源:YourDataActivity.java

示例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;
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:17,代码来源:PickFolderWithOpenerActivity.java

示例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;
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:17,代码来源:CreateFileWithCreatorActivity.java

示例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);
    }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:19,代码来源:PinFileActivity.java

示例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);
    }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:20,代码来源:ListenChangeEventsForFilesActivity.java

示例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;
    }
}
 
开发者ID:claudiodegio,项目名称:dbsync,代码行数:37,代码来源:BaseMainDbActivity.java

示例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);
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:16,代码来源:PickFileWithOpenerActivity.java


注:本文中的com.google.android.gms.drive.OpenFileActivityBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。