mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-16 21:54:05 +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() {
|
new Handler().post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
try {
|
||||||
BluetoothDeviceView notSupported = new BluetoothDeviceView(requireContext());
|
BluetoothDeviceView notSupported = new BluetoothDeviceView(requireContext());
|
||||||
notSupported.setDeviceName(requireContext().getString(R.string.label_scale_not_supported));
|
notSupported.setDeviceName(requireContext().getString(R.string.label_scale_not_supported));
|
||||||
notSupported.setSummaryText(requireContext().getString(R.string.label_click_to_help_add_support));
|
notSupported.setSummaryText(requireContext().getString(R.string.label_click_to_help_add_support));
|
||||||
@@ -174,6 +175,9 @@ public class BluetoothSettingsFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
deviceListView.addView(notSupported);
|
deviceListView.addView(notSupported);
|
||||||
|
} catch(IllegalStateException ex) {
|
||||||
|
Timber.e(ex.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user