From 8209559012169504781ad81a2e1cdf25527a7ab1 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 7 Dec 2020 15:48:20 +0100 Subject: [PATCH] Some fixes --- .../org/eu/exodus_privacy/exodusprivacy/MainActivity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/MainActivity.java b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/MainActivity.java index 11a665e..d0e32a1 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/MainActivity.java +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/MainActivity.java @@ -29,6 +29,7 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.inputmethod.InputMethodManager; +import android.widget.ImageView; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.SearchView; @@ -187,6 +188,13 @@ public class MainActivity extends AppCompatActivity { searchView.setQuery(previousQuery, false); } }); + ImageView searchClose = searchView.findViewById(androidx.appcompat.R.id.search_close_btn); + if (searchClose != null) { + searchClose.setOnClickListener(v -> { + previousQuery = ""; + searchView.setQuery("", true); + }); + } searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) {