Detect when the app previously crashed
This commit is contained in:
parent
a6334f37a0
commit
23f0842e9a
1 changed files with 17 additions and 12 deletions
|
@ -15,6 +15,7 @@ import eu.depau.ddroid.utils.*
|
|||
import eu.depau.ddroid.values.FlashMethod
|
||||
import eu.depau.ddroid.values.WizardStep
|
||||
import kotlinx.android.synthetic.main.fragment_confirminfo.view.*
|
||||
import java.io.IOException
|
||||
|
||||
/**
|
||||
* A placeholder fragment containing a simple view.
|
||||
|
@ -63,6 +64,7 @@ class ConfirmInfoFragment : WizardFragment() {
|
|||
|
||||
view.confirm_sel_usbdev.text = StateKeeper.usbDevice?.name
|
||||
|
||||
try {
|
||||
StateKeeper.usbMassStorageDevice!!.init()
|
||||
val blockDev = StateKeeper.usbMassStorageDevice?.blockDevice
|
||||
|
||||
|
@ -79,6 +81,9 @@ class ConfirmInfoFragment : WizardFragment() {
|
|||
} else {
|
||||
view.confirm_extra_info.text = getString(R.string.cant_read_usbdev)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
view.confirm_extra_info.text = "Could not access USB device. Maybe you ran the app previously and it crashed? Remove and reinsert the USB drive, then restart the app."
|
||||
}
|
||||
|
||||
return view
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue