mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-17 22:11:35 +02:00
Fixed a crash when selecting a Bluetooth device during the slideshow, see #639
This commit is contained in:
@@ -523,7 +523,7 @@ public class ChartMeasurementView extends LineChart {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PolynomialFitter polyFitter = new PolynomialFitter(3);
|
PolynomialFitter polyFitter = new PolynomialFitter(lineEntries.size() == 2 ? 2 : 3);
|
||||||
|
|
||||||
// use only the last 30 values for the polynomial fitter
|
// use only the last 30 values for the polynomial fitter
|
||||||
for (int i=1; i<30; i++) {
|
for (int i=1; i<30; i++) {
|
||||||
|
@@ -362,8 +362,12 @@ public class BluetoothSettingsFragment extends Fragment {
|
|||||||
Timber.d("Saved Bluetooth device " + device.getName() + " with address " + device.getAddress());
|
Timber.d("Saved Bluetooth device " + device.getName() + " with address " + device.getAddress());
|
||||||
|
|
||||||
stopBluetoothDiscovery();
|
stopBluetoothDiscovery();
|
||||||
|
|
||||||
|
if (getActivity().findViewById(R.id.nav_host_fragment) != null){
|
||||||
Navigation.findNavController(requireActivity(), R.id.nav_host_fragment).getPreviousBackStackEntry().getSavedStateHandle().set("update", true);
|
Navigation.findNavController(requireActivity(), R.id.nav_host_fragment).getPreviousBackStackEntry().getSavedStateHandle().set("update", true);
|
||||||
Navigation.findNavController(requireActivity(), R.id.nav_host_fragment).navigateUp();
|
Navigation.findNavController(requireActivity(), R.id.nav_host_fragment).navigateUp();
|
||||||
|
} else
|
||||||
|
getActivity().finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user