diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt index fbfeae4b8b..b58c4dd0bb 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt @@ -102,10 +102,12 @@ class OmnipodOverviewFragment : DaggerFragment() { omnipod_overview_button_pod_management.setOnClickListener { if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) { activity?.let { activity -> - protectionCheck.queryProtection( - activity, ProtectionCheck.Protection.PREFERENCES, - UIRunnable(Runnable { startActivity(Intent(context, PodManagementActivity::class.java)) }) - ) + context?.let { context -> + protectionCheck.queryProtection( + activity, ProtectionCheck.Protection.PREFERENCES, + UIRunnable { startActivity(Intent(context, PodManagementActivity::class.java)) } + ) + } } } else { displayNotConfiguredDialog() @@ -514,10 +516,10 @@ class OmnipodOverviewFragment : DaggerFragment() { private fun displayNotConfiguredDialog() { context?.let { - UIRunnable(Runnable { + UIRunnable { OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning), resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null) - }).run() + }.run() } } @@ -534,9 +536,9 @@ class OmnipodOverviewFragment : DaggerFragment() { private fun displayOkDialog(title: String, message: String) { context?.let { - UIRunnable(Runnable { + UIRunnable { OKDialog.show(it, title, message, null) - }).run() + }.run() } } diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java index 271a769d46..250a0a69b8 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java @@ -65,6 +65,11 @@ public class InitializePumpManagerTask extends ServiceTask { lastGoodFrequency = rileyLinkServiceData.lastGoodFrequency; } + /* FIXME this can apparently crash: + Fatal Exception: java.lang.ClassCastException + info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin + cannot be cast to info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice + */ RileyLinkCommunicationManager rileyLinkCommunicationManager = ((RileyLinkPumpDevice) activePlugin.getActivePump()).getRileyLinkService().getDeviceCommunicationManager(); if (activePlugin.getActivePump().manufacturer() == ManufacturerType.Medtronic) {