Example usage for android.os.storage VolumeInfo getId

List of usage examples for android.os.storage VolumeInfo getId

Introduction

In this page you can find the example usage for android.os.storage VolumeInfo getId.

Prototype

@UnsupportedAppUsage
    public @NonNull String getId() 

Source Link

Usage

From source file:com.android.tv.settings.device.storage.FormatActivity.java

private void launchMigrateStorageAndFinish(String diskId) {
    final List<VolumeInfo> candidates = mPackageManager.getPrimaryStorageCandidateVolumes();
    VolumeInfo moveTarget = null;
    for (final VolumeInfo candidate : candidates) {
        if (TextUtils.equals(candidate.getDiskId(), diskId)) {
            moveTarget = candidate;/*from www.j av  a  2  s .c  o  m*/
            break;
        }
    }

    if (moveTarget != null) {
        startActivity(MigrateStorageActivity.getLaunchIntent(this, moveTarget.getId(), true));
    }

    finish();
}