diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java index 61bd62a1e2..1b4ef91f95 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java @@ -210,7 +210,7 @@ public class TravelDbHelper { TravelArticle travelArticle; SQLiteCursor cursor = conn.rawQuery("SELECT * FROM " + ARTICLES_TABLE_NAME - + " WHERE title IN (SELECT title FROM " + + " WHERE article_id IN (SELECT article_id FROM " + ARTICLES_TABLE_NAME + " ORDER BY RANDOM() LIMIT 100) LIMIT 100", null); if (cursor.moveToFirst()) { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java index 7df07075b9..a62172d333 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java @@ -35,7 +35,6 @@ public class ExploreTabFragment extends BaseOsmAndFragment { private static final int DOWNLOAD_UPDATE_CARD_POSITION = 0; private ExploreRvAdapter adapter = new ExploreRvAdapter(); - private PopularDestinationsSearchTask popularDestinationsSearchTask; private StartEditingTravelCard startEditingTravelCard; private ProgressBar progressBar; @@ -43,11 +42,11 @@ public class ExploreTabFragment extends BaseOsmAndFragment { @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { final View mainView = inflater.inflate(R.layout.fragment_explore_tab, container, false); + progressBar = (ProgressBar) mainView.findViewById(R.id.progressBar); + final RecyclerView rv = (RecyclerView) mainView.findViewById(R.id.recycler_view); adapter.setItems(generateItems()); - final RecyclerView rv = (RecyclerView) mainView.findViewById(R.id.recycler_view); - progressBar = (ProgressBar) mainView.findViewById(R.id.progressBar); rv.setLayoutManager(new LinearLayoutManager(getContext())); rv.setAdapter(adapter); @@ -84,7 +83,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment { } private void addPopularDestinations(OsmandApplication app, boolean nightMode) { - popularDestinationsSearchTask = new PopularDestinationsSearchTask(app.getTravelDbHelper(), getMyActivity(), adapter, nightMode, startEditingTravelCard, progressBar); + PopularDestinationsSearchTask popularDestinationsSearchTask = new PopularDestinationsSearchTask(app.getTravelDbHelper(), getMyActivity(), adapter, nightMode, startEditingTravelCard, progressBar); popularDestinationsSearchTask.execute(); }