From 92952c99436725a652fec7b397c8bdf1e87f6271 Mon Sep 17 00:00:00 2001 From: Ashish Jaddu <51579203+ashishreddy2411@users.noreply.github.com> Date: Sun, 26 Nov 2023 22:02:02 -0500 Subject: [PATCH] Updated Integration. --- .../de/dennisguse/opentracks/TrackStoppedActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/dennisguse/opentracks/TrackStoppedActivity.java b/src/main/java/de/dennisguse/opentracks/TrackStoppedActivity.java index 386aabc98..49b5b237d 100644 --- a/src/main/java/de/dennisguse/opentracks/TrackStoppedActivity.java +++ b/src/main/java/de/dennisguse/opentracks/TrackStoppedActivity.java @@ -16,6 +16,7 @@ import de.dennisguse.opentracks.fragments.ChooseActivityTypeDialogFragment; import de.dennisguse.opentracks.services.TrackRecordingServiceConnection; import de.dennisguse.opentracks.settings.PreferencesUtils; +import de.dennisguse.opentracks.stats.SensorStatistics; import de.dennisguse.opentracks.ui.aggregatedStatistics.ConfirmDeleteDialogFragment; import de.dennisguse.opentracks.util.ExportUtils; import de.dennisguse.opentracks.util.IntentUtils; @@ -46,9 +47,12 @@ protected void onCreate(Bundle savedInstanceState) { ContentProviderUtils contentProviderUtils = new ContentProviderUtils(this); Track track = contentProviderUtils.getTrack(trackId); - try { + try { SensorStatistics sensorStatistics = contentProviderUtils.getSensorStats(trackId); - float maxHr = sensorStatistics.getMaxHeartRate().getBPM(); + if(sensorStatistics!=null) + { + float maxHr = sensorStatistics.getMaxHeartRate().getBPM(); + } }catch (Exception e){} viewBinding.trackEditName.setText(track.getName());