Created
January 15, 2017 15:10
-
-
Save serhiitereshchenko/cbf4f6bb9e4b683ef5ee276e24790dee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onActivityResult(int requestCode, int resultCode, Intent data) { | |
super.onActivityResult(requestCode, resultCode, data); | |
if (requestCode == FILE_CODE && resultCode == Activity.RESULT_OK) { | |
if (BuildConfig.VERSION_CODE > Build.VERSION_CODES.KITKAT) { | |
Uri uri = data.getData(); | |
pathEditText.setText(uri.toString()); | |
} else { | |
Uri uri = DocumentFile.fromFile(new File(data.getData().getPath())).getUri(); | |
pathEditText.setText(uri.toString()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment