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:
@@ -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());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user