show an additional dialog before displaying the OTG permission one
This commit is contained in:
parent
d7a6bdfb10
commit
6bb69e3d9f
1 changed files with 5 additions and 2 deletions
|
@ -17,6 +17,7 @@ import android.widget.Toast
|
||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
import androidx.core.view.MenuItemCompat
|
import androidx.core.view.MenuItemCompat
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
||||||
import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog
|
import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog
|
||||||
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
|
@ -356,10 +357,12 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
Thread {
|
Thread {
|
||||||
if (hasOTGConnected()) {
|
if (hasOTGConnected()) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
ConfirmationDialog(this, getString(R.string.otg_detected), positive = R.string.ok, negative = 0) {
|
||||||
handleOTGPermission {
|
handleOTGPermission {
|
||||||
config.addIncludedFolder(OTG_PATH)
|
config.addIncludedFolder(OTG_PATH)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
config.wasOTGHandled = true
|
config.wasOTGHandled = true
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
|
|
Loading…
Reference in a new issue