diff --git a/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt b/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt index 33f48703..2cbe5fef 100644 --- a/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt +++ b/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt @@ -18,7 +18,6 @@ import java.util.* import kotlin.comparisons.compareBy class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener { - val SELECT_FOLDER_REQUEST = 1 val SELECT_FOLDER_PATH = "path" companion object { @@ -37,9 +36,11 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener { } lateinit var dialog: View + var requestCode = 0 override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { dialog = activity.layoutInflater.inflate(R.layout.smtfp_directory_picker, null) + requestCode = targetRequestCode updateItems() setupBreadcrumbs() @@ -78,7 +79,7 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener { private fun sendResult() { val intent = Intent() intent.putExtra(SELECT_FOLDER_PATH, mPath) - targetFragment.onActivityResult(SELECT_FOLDER_REQUEST, Activity.RESULT_OK, intent) + targetFragment.onActivityResult(requestCode, Activity.RESULT_OK, intent) dismiss() } diff --git a/library/src/main/kotlin/com/simplemobiletools/filepicker/views/Breadcrumbs.kt b/library/src/main/kotlin/com/simplemobiletools/filepicker/views/Breadcrumbs.kt index 866cb625..093f1e6c 100644 --- a/library/src/main/kotlin/com/simplemobiletools/filepicker/views/Breadcrumbs.kt +++ b/library/src/main/kotlin/com/simplemobiletools/filepicker/views/Breadcrumbs.kt @@ -128,7 +128,7 @@ class Breadcrumbs(context: Context, attrs: AttributeSet) : LinearLayout(context, } } - fun addBreadcrumb(item: FileDirItem, addPrefix: Boolean) { + private fun addBreadcrumb(item: FileDirItem, addPrefix: Boolean) { val view = mInflater!!.inflate(R.layout.smtfp_breadcrumb_item, null, false) var textToAdd = item.name if (addPrefix)