From 565b3fd14cec64c8db025c11e15ce03d5e102aac Mon Sep 17 00:00:00 2001 From: vdbhb59 <60728004+vdbhb59@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:11:03 +0000 Subject: [PATCH] Fix media browser service and enable android auto support Fix media browser service and enable android auto support --- .../radiodroid2/station/FragmentStations.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/programmierecke/radiodroid2/station/FragmentStations.java b/app/src/main/java/net/programmierecke/radiodroid2/station/FragmentStations.java index 3d761b38e..531ef068d 100644 --- a/app/src/main/java/net/programmierecke/radiodroid2/station/FragmentStations.java +++ b/app/src/main/java/net/programmierecke/radiodroid2/station/FragmentStations.java @@ -24,6 +24,7 @@ import net.programmierecke.radiodroid2.FragmentBase; import net.programmierecke.radiodroid2.R; import net.programmierecke.radiodroid2.RadioDroidApp; +import net.programmierecke.radiodroid2.StationSaveManager; import net.programmierecke.radiodroid2.Utils; import net.programmierecke.radiodroid2.interfaces.IFragmentSearchable; import net.programmierecke.radiodroid2.utils.CustomFilter; @@ -48,6 +49,7 @@ public class FragmentStations extends FragmentBase implements IFragmentSearchabl private StationsFilter stationsFilter; private StationsFilter.SearchStyle lastSearchStyle = StationsFilter.SearchStyle.ByName; private String lastQuery = ""; + private StationSaveManager queue; void onStationClick(DataRadioStation theStation, int pos) { RadioDroidApp radioDroidApp = (RadioDroidApp) getActivity().getApplication(); @@ -71,6 +73,8 @@ protected void RefreshListGui() { ArrayList filteredStationsList = new ArrayList<>(); List radioStations = DataRadioStation.DecodeJson(getUrlResult()); + queue.clear(); + queue.addAll(radioStations); if (BuildConfig.DEBUG) Log.d(TAG, "station count:" + radioStations.size()); @@ -93,6 +97,7 @@ protected void RefreshListGui() { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log.d("STATIONS","onCreateView()"); + queue = new StationSaveManager(getContext()); Bundle bundle = getArguments(); if (bundle != null) { searchEnabled = bundle.getBoolean(KEY_SEARCH_ENABLED, false); @@ -219,4 +224,4 @@ protected void DownloadFinished() { swipeRefreshLayout.setRefreshing(false); } } -} \ No newline at end of file +}