1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-15 21:24:10 +02:00

catch illegal state argument if context is lost

This commit is contained in:
oliexdev
2020-12-02 11:20:43 +01:00
parent c32b02e279
commit 4d9f1a878f

View File

@@ -160,6 +160,7 @@ public class BluetoothSettingsFragment extends Fragment {
new Handler().post(new Runnable() {
@Override
public void run() {
try {
BluetoothDeviceView notSupported = new BluetoothDeviceView(requireContext());
notSupported.setDeviceName(requireContext().getString(R.string.label_scale_not_supported));
notSupported.setSummaryText(requireContext().getString(R.string.label_click_to_help_add_support));
@@ -174,6 +175,9 @@ public class BluetoothSettingsFragment extends Fragment {
}
});
deviceListView.addView(notSupported);
} catch(IllegalStateException ex) {
Timber.e(ex.getMessage());
}
}
});
}