1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-09 03:37:03 +01:00

Fix crash on manual heart rate

This commit is contained in:
José Rebelo 2024-07-25 22:42:25 +01:00
parent 5a6a39d059
commit c72420281a

View File

@ -65,7 +65,7 @@ public class HeartRateDialog extends Dialog {
setMeasurementResults(intent.getSerializableExtra(DeviceService.EXTRA_REALTIME_SAMPLE)); setMeasurementResults(intent.getSerializableExtra(DeviceService.EXTRA_REALTIME_SAMPLE));
break; break;
default: default:
LOG.info("ignoring intent action " + intent.getAction()); LOG.info("ignoring intent action {}", intent.getAction());
break; break;
} }
} }
@ -132,12 +132,8 @@ public class HeartRateDialog extends Dialog {
heart_rate_dialog_results_layout.setVisibility(View.GONE); heart_rate_dialog_results_layout.setVisibility(View.GONE);
heart_rate_dialog_loading_layout.setVisibility(View.VISIBLE); heart_rate_dialog_loading_layout.setVisibility(View.VISIBLE);
setOnCancelListener(new DialogInterface.OnCancelListener() { setOnCancelListener(dialogInterface -> {
@Override
public void onCancel(DialogInterface dialogInterface) {
LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(mReceiver); LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(mReceiver);
getContext().unregisterReceiver(mReceiver);
}
}); });
} }
} }