Example usage for android.provider DocumentsContract EXTRA_SHOW_ADVANCED

List of usage examples for android.provider DocumentsContract EXTRA_SHOW_ADVANCED

Introduction

In this page you can find the example usage for android.provider DocumentsContract EXTRA_SHOW_ADVANCED.

Prototype

String EXTRA_SHOW_ADVANCED

To view the source code for android.provider DocumentsContract EXTRA_SHOW_ADVANCED.

Click Source Link

Usage

From source file:com.android.documentsui.DocumentsActivity.java

private void buildDefaultState() {
    mState = new State();

    final Intent intent = getIntent();
    final String action = intent.getAction();
    if (Intent.ACTION_OPEN_DOCUMENT.equals(action)) {
        mState.action = ACTION_OPEN;//  w  ww.  ja  va  2  s.c o  m
    } else if (Intent.ACTION_CREATE_DOCUMENT.equals(action)) {
        mState.action = ACTION_CREATE;
    } else if (Intent.ACTION_GET_CONTENT.equals(action)) {
        mState.action = ACTION_GET_CONTENT;
    } else if (DocumentsContract.ACTION_MANAGE_ROOT.equals(action)) {
        mState.action = ACTION_MANAGE;
    }

    if (mState.action == ACTION_OPEN || mState.action == ACTION_GET_CONTENT) {
        mState.allowMultiple = intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
    }

    if (mState.action == ACTION_MANAGE) {
        mState.acceptMimes = new String[] { "*/*" };
        mState.allowMultiple = true;
    } else if (intent.hasExtra(Intent.EXTRA_MIME_TYPES)) {
        mState.acceptMimes = intent.getStringArrayExtra(Intent.EXTRA_MIME_TYPES);
    } else {
        mState.acceptMimes = new String[] { intent.getType() };
    }

    mState.localOnly = intent.getBooleanExtra(Intent.EXTRA_LOCAL_ONLY, false);
    mState.forceAdvanced = intent.getBooleanExtra(DocumentsContract.EXTRA_SHOW_ADVANCED, false);
    mState.showAdvanced = mState.forceAdvanced | SettingsActivity.getDisplayAdvancedDevices(this);
}

From source file:cn.edu.wyu.documentviewer.DocumentsActivity.java

private void buildDefaultState() {
    mState = new State();

    final Intent intent = virtualIntent;
    final String action = intent.getAction();
    if (Intent.ACTION_OPEN_DOCUMENT.equals(action)) {
        mState.action = ACTION_OPEN;/*from www  .j  a  v  a  2  s  .c om*/
    } else if (Intent.ACTION_CREATE_DOCUMENT.equals(action)) {
        mState.action = ACTION_CREATE;
    } else if (Intent.ACTION_GET_CONTENT.equals(action)) {
        mState.action = ACTION_GET_CONTENT;
    } else if (DocumentsContract.ACTION_MANAGE_ROOT.equals(action)) {
        mState.action = ACTION_MANAGE;
    }

    if (mState.action == ACTION_OPEN || mState.action == ACTION_GET_CONTENT) {
        mState.allowMultiple = intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
    }

    if (mState.action == ACTION_MANAGE) {
        mState.acceptMimes = new String[] { "*/*" };
        mState.allowMultiple = true;
    } else if (intent.hasExtra(Intent.EXTRA_MIME_TYPES)) {
        mState.acceptMimes = intent.getStringArrayExtra(Intent.EXTRA_MIME_TYPES);
    } else {
        mState.acceptMimes = new String[] { intent.getType() };
    }

    mState.localOnly = intent.getBooleanExtra(Intent.EXTRA_LOCAL_ONLY, false);
    mState.forceAdvanced = intent.getBooleanExtra(DocumentsContract.EXTRA_SHOW_ADVANCED, false);
    mState.showAdvanced = mState.forceAdvanced | SettingsActivity.getDisplayAdvancedDevices(this);
}