if device goes away at just the right time, user won't be able to set channel

pull/95/head
geeksville 2020-07-08 08:29:53 -07:00
rodzic 931cfb52d3
commit 49752d0550
1 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -333,7 +333,7 @@ class MainActivity : AppCompatActivity(), Logging,
/// Ask user to rate in play store /// Ask user to rate in play store
private fun askToRate() { private fun askToRate() {
exceptionReporter { // Got one IllegalArgumentException from inside this lib, but we don't want to crash our app because of bugs in this optional feature exceptionReporter { // Got one IllegalArgumentException from inside this lib, but we don't want to crash our app because of bugs in this optional feature
AppRate.with(this) AppRate.with(this)
.setInstallDays(10.toByte()) // default is 10, 0 means install day, 10 means app is launched 10 or more days later than installation .setInstallDays(10.toByte()) // default is 10, 0 means install day, 10 means app is launched 10 or more days later than installation
.setLaunchTimes(10.toByte()) // default is 10, 3 means app is launched 3 or more times .setLaunchTimes(10.toByte()) // default is 10, 3 means app is launched 3 or more times
@ -646,7 +646,16 @@ class MainActivity : AppCompatActivity(), Logging,
} }
.setPositiveButton(R.string.accept) { _, _ -> .setPositiveButton(R.string.accept) { _, _ ->
debug("Setting channel from URL") debug("Setting channel from URL")
model.setChannel(channel.settings) try {
model.setChannel(channel.settings)
} catch (ex: RemoteException) {
errormsg("Couldn't change channel ${ex.message}")
Toast.makeText(
this,
"Couldn't change channel, because radio is not yet connected. Please try again.",
Toast.LENGTH_SHORT
).show()
}
} }
.show() .show()
} }