Bugfix: view changed from wrong thread. Fixes
@@ -175,6 +175,8 @@ public class IntervalsFragment extends Fragment implements TrackDataListener {
@Override
public void onTrackUpdated(Track track) {
+ if (isResumed()) {
+ getActivity().runOnUiThread(() -> {
if (isResumed()) {
// Set category.
category = track != null ? track.getCategory() : "";
@@ -183,6 +185,8 @@ public class IntervalsFragment extends Fragment implements TrackDataListener {
boolean reportSpeed = PreferencesUtils.isReportSpeed(getContext(), category);
viewBinding.intervalRate.setText(reportSpeed ? R.string.stats_speed : R.string.stats_pace);
}
+ });
+ }
}
@Override
