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
/* | |
* When the Activity of the app that hosts files sets a result and calls | |
* finish(), this method is invoked. The returned Intent contains the | |
* content URI of a selected file. The result code indicates if the | |
* selection worked or not. | |
*/ | |
public override fun onActivityResult(requestCode: Int, resultCode: Int, returnIntent: Intent) { | |
// If the selection didn't work | |
if (resultCode != Activity.RESULT_OK) { | |
// Exit without doing anything else |
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
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |
... | |
<application> | |
... | |
<activity | |
android:name=".FileSelectActivity" | |
android:label="@File Selector" > | |
<intent-filter> | |
<action | |
android:name="android.intent.action.PICK"/> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<paths> | |
// Represents files in the files/ subdirectory of your app's internal storage area. | |
// This subdirectory is the same as the value returned by Context.getFilesDir(). | |
//file path will be storage/data/user/0/Android/data/{your app package}/files/.../ | |
<files-path name="name" path="path" /> | |
//Represents files in the root of the external storage area. |