Questions tagged [android-search]

Search is a core user feature on Android. Users should be able to search any data that is available to them, whether the content is located on the device or the Internet. To help create a consistent search experience for users, Android provides a search framework that helps you implement search for your application.

The search framework offers two modes of search input: a search dialog at the top of the screen or a search widget (SearchView) that you can embed in your activity layout. In either case, the Android system will assist your search implementation by delivering search queries to a specific activity that performs searchs. You can also enable either the search dialog or widget to provide search suggestions as the user types. Figure 1 shows an example of the search dialog with optional search suggestions.

Once you've set up either the search dialog or the search widget, you can:

  • Enable voice search
  • Provide search suggestions based on recent user queries
  • Provide custom search suggestions that match actual results in your application data
  • Offer your application's search suggestions in the system-wide Quick Search Box

The following documents show you how to use Android's framework to implement search:

Creating a Search Interface:

How to set up your application to use the search dialog or search widget.

Adding Recent Query Suggestions:

How to provide suggestions based on queries previously used.

Adding Custom Suggestions:

How to provide suggestions based on custom data from your application and also offer them in the system-wide Quick Search Box.

Searchable Configuration:

A reference document for the searchable configuration file (though the other documents also discuss the configuration file in terms of specific behaviors).

413 questions
1
vote
1 answer

Search items from listview with custom adapter

Am trying search from listview using custom adapter. i have search widget in toolbar menu and i can display widget. when i click on search icon, it expands, but when i start typing, search does not happen and list gets cleared. can someone plz trace…
Sagar Pawar
  • 465
  • 4
  • 26
1
vote
1 answer

How do I ignore case for characters to be highligted while searching in spannable strings?

I have implemented a search mechanism in my app such that, when you filter through the names in the list, it highlights the names that match, with only issue being it only highlights the lowercase letters and doesn't highlight any words that are in…
user11455292
1
vote
1 answer

SearchView fires only the second time when using a filter in ArrayAdapter

I have added in the Toolbar a SearchView to filter some items. @Override public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.menu, menu); …
Jorn
  • 252
  • 1
  • 15
1
vote
1 answer

Problem with searching String name in RecyclerView that contains String name and String subtext

Well, I have a RecyclerView, whose Items contains name and subtext. I created a class MyObject in order to fill them. With my Adapter, I am filling the RecyclerView. I want to search for a String name in my RecyclerView and that the application…
1
vote
1 answer

SearchView in expanded mode doesn't hide all action bar icons starting from Marshmallow

SearchView looks fine on Lollipop devices (Android 21): But on Android 23-28 it doesn't hide all icons on the right side:
1
vote
0 answers

Search Arabic custom listview

I have a custom listview which has Arabic strings.I want to search for a specific view (row) in that listview .I use addTextChangedListener in my main activity like below editsearch = (EditText) findViewById(R.id.search); …
1
vote
1 answer

SearchView: Why not show glass icon

Android studio 3.2.1 in my app/build.gradle: android { compileSdkVersion 28 defaultConfig { applicationId "com.myproject" minSdkVersion 18 targetSdkVersion 28 versionCode 1 versionName "1.1.1" here my…
Alexei
  • 14,350
  • 37
  • 121
  • 240
1
vote
0 answers

Unusual line before SearchView when used in an action layout

I am trying to implement a SearchView and a menu option (as icon) on the toolbar. Here is the menu.xml
Renjith
  • 3,457
  • 5
  • 46
  • 67
1
vote
2 answers

How To Scroll To A Desired Position In ScrollView?

I have an EditText with number input, a button and a ScrollView one below the other. Inside the ScrollView I have a Linear Layout with vertical orientation and inside the Layout I have about 50 TextViews each with id 1,2,3,4.... What I want is that…
1
vote
1 answer

How to lower the search Icon in my actionBar?

For some reason my search icon is positioned a little bit higher than the settings icon. How do I lower the position of the search icon to match the settings icon in actionBar. Here's what I mean: Here's my code for search icon, I got this icon…
iBEK
  • 622
  • 2
  • 8
  • 27
1
vote
1 answer

How to close searchView in onOptionsItemSelected(MenuItem item) when onBackPressed don't work?

Need code to close the searchView when BACK is pressed. So far only have code that closes the keyboard when BACK is pressed. @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (item.getItemId() ==…
iBEK
  • 622
  • 2
  • 8
  • 27
1
vote
1 answer

Showing name,number and contact type in searchview contact suggestions

I am using the following searchable xml for autosuggesting options when user types a contact name in the SearchView.
SoulRayder
  • 5,072
  • 6
  • 47
  • 93
1
vote
0 answers

How to make the searchview to search the data in realm database?

I am facing the issue in search view top search the data in realm database.I have implemented the search view and problem is how to pass the search query to the realm database to search data. My search view implementation is SearchView searchView…
Prabha Karan
  • 1,309
  • 3
  • 17
  • 35
1
vote
0 answers

Prefil Google Places Placer Picker search bar on Android?

I dont see an official way, is there a workaround to prefill the search bar (and perform search) in the Google Places API's Place Picker for android? https://developers.google.com/places/android-api/placepicker Thanks! As of the post, using the…
1
vote
1 answer

Issues getting search data in listview

I have implemented filterable in customadapter class and i am able to search through listview ,but when i empty my searchbox my list still show the last search app and not with whole app list. mainactivity.java public class MainActivity extends…