From b1b30fa38d6716009a864c4c7a378219016cea28 Mon Sep 17 00:00:00 2001 From: millanp Date: Tue, 9 Jan 2024 01:21:52 -0800 Subject: [PATCH] Fix bug Fully fix Fully fix Fully fix Fully fix --- .../onebusaway/android/ui/RouteFavoriteDialogFragment.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/ui/RouteFavoriteDialogFragment.java b/onebusaway-android/src/main/java/org/onebusaway/android/ui/RouteFavoriteDialogFragment.java index 89c0b9604..51d2a2110 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/ui/RouteFavoriteDialogFragment.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/ui/RouteFavoriteDialogFragment.java @@ -28,6 +28,7 @@ import android.util.Log; import androidx.fragment.app.DialogFragment; +import androidx.loader.app.LoaderManager; /** * Asks the user if they was to save a route/headsign favorite for all stops, or just this stop @@ -210,7 +211,8 @@ public void onClick(DialogInterface dialog, int id) { // Saved the favorite for just this stop QueryUtils.setFavoriteRouteAndHeadsign(getActivity(), routeUri, headsign, stopId, values, favorite); - getLoaderManager().initLoader(ROUTE_INFO_LOADER, null, + LoaderManager.getInstance(getActivity()).restartLoader( + ROUTE_INFO_LOADER, null, new QueryUtils.RouteLoaderCallback(getActivity(), routeId)); mCallback.onSelectionComplete(true); @@ -221,7 +223,8 @@ public void onClick(DialogInterface dialog, int id) { routeUri, headsign, null, values, favorite); // Request the full details of the starred route, so that // the long name can be displayed later - getLoaderManager().initLoader(ROUTE_INFO_LOADER, null, + LoaderManager.getInstance(getActivity()).restartLoader( + ROUTE_INFO_LOADER, null, new QueryUtils.RouteLoaderCallback(getActivity(), routeId)); mCallback.onSelectionComplete(true);