FileDocCategorySizeDatePackage
GrantActivity.javaAPI DocAndroid 5.1 API1625Thu Mar 12 22:22:56 GMT 2015android.support.tests

GrantActivity

public class GrantActivity extends android.app.Activity
Stub activity used to request a permission grant for {@link DocumentFileTest}.

Fields Summary
Constructors Summary
Methods Summary
protected voidonActivityResult(int requestCode, int resultCode, android.content.Intent data)

        if (requestCode == 12 && resultCode == RESULT_OK) {
            final ContentResolver resolver = getContentResolver();
            resolver.takePersistableUriPermission(data.getData(),
                    Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
        }
    
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        final Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
        startActivityForResult(intent, 12);