mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-03 11:57:49 +01:00
return the result of SelectFolderDialog as uri data
This commit is contained in:
parent
2cdc142ee9
commit
07d4b84e52
@ -60,7 +60,6 @@ public class ItemsFragment extends android.support.v4.app.Fragment
|
||||
@BindView(R.id.items_holder) CoordinatorLayout mCoordinatorLayout;
|
||||
|
||||
public static final int SELECT_FOLDER_REQUEST = 1;
|
||||
public static final String SELECT_FOLDER_PATH = "path";
|
||||
|
||||
private List<FileDirItem> mItems;
|
||||
private ItemInteractionListener mListener;
|
||||
@ -562,7 +561,7 @@ public class ItemsFragment extends android.support.v4.app.Fragment
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == SELECT_FOLDER_REQUEST && resultCode == Activity.RESULT_OK && data != null) {
|
||||
mCopyDestinationPath = data.getStringExtra(SELECT_FOLDER_PATH);
|
||||
mCopyDestinationPath = data.getDataString();
|
||||
mDestinationView.setText(mCopyDestinationPath);
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
@ -3,6 +3,7 @@ package com.simplemobiletools.filepicker.dialogs
|
||||
import android.app.Activity
|
||||
import android.app.Dialog
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.support.v4.app.DialogFragment
|
||||
import android.support.v7.app.AlertDialog
|
||||
@ -24,7 +25,6 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener {
|
||||
var mFirstUpdate: Boolean = true
|
||||
var mShowHidden: Boolean = false
|
||||
var mShowFullPath: Boolean = false
|
||||
val SELECT_FOLDER_PATH = "path"
|
||||
|
||||
fun newInstance(path: String, showHidden: Boolean, showFullPath: Boolean): SelectFolderDialog {
|
||||
mPath = path
|
||||
@ -78,7 +78,7 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener {
|
||||
|
||||
private fun sendResult() {
|
||||
val intent = Intent()
|
||||
intent.putExtra(SELECT_FOLDER_PATH, mPath)
|
||||
intent.data = Uri.parse(mPath)
|
||||
targetFragment.onActivityResult(requestCode, Activity.RESULT_OK, intent)
|
||||
dismiss()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user