From 3ecb39bc3edbccfb1fccf2a097a77bf3361d3ac8 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Sun, 18 Jul 2021 22:43:58 +0800 Subject: Open search results when clicking a trending search. --- .../infinityforreddit/activities/TrendingActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/ml') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java index 1bc8d3e3..0bfe7efe 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java @@ -1,5 +1,6 @@ package ml.docilealligator.infinityforreddit.activities; +import android.content.Intent; import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; @@ -144,7 +145,10 @@ public class TrendingActivity extends BaseActivity { dataSavingMode, disableImagePreview, new TrendingSearchRecyclerViewAdapter.ItemClickListener() { @Override public void onClick(TrendingSearch trendingSearch) { - + Intent intent = new Intent(TrendingActivity.this, SearchResultActivity.class); + intent.putExtra(SearchResultActivity.EXTRA_QUERY, trendingSearch.queryString); + intent.putExtra(SearchResultActivity.EXTRA_TRENDING_SOURCE, "trending"); + startActivity(intent); } }); recyclerView.setLayoutManager(new LinearLayoutManager(this)); -- cgit v1.2.3