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
4
votes
1 answer

android Place Autocomplete how to get list of searched place on top by default

I implement place autocomplete in my application and write search keyword in EditText to get result according to search place keyword. here the code for start PlaceAutocomplete activity to search place int PLACE_AUTOCOMPLETE_REQUEST_CODE = 1; try…
Hitesh Gehlot
  • 1,307
  • 1
  • 15
  • 30
4
votes
0 answers

Error inflating class android.support.v7.widget.SearchView. Similar questions on SO did not solve it

Here is an SSCCE. I am using 23.1.1 version of appcompat_v7 support library. I am running it on a Genymotion emulator with version 23 of Android SDK. The exact error from the logcat is given at the end. activity_main.xml:
4
votes
1 answer

Android search bar with mic & mic events. Android searchview with mic

I am using a searchview in my application. I want to get the text typed in the searchview textbox and display it on another textview. I can do that using searchviewListener. searchView.setOnQueryTextListener(new…
Devesh Agrawal
  • 8,982
  • 16
  • 82
  • 131
4
votes
3 answers

How do I search email list for a particular format?

I am looking for a regular expression that can help me search a list of email strings such that say, if I have an arraylist with a couple of emails listed such that : firstname.lastname@company.com , firstname1.lastname1@company.com I would like to…
user2386226
4
votes
1 answer

Intercept VOICE_COMMAND on Bluetooth Headset

I have an app where I wish to pick up the button on a bluetooth hands free headset and do my own functionality. I think this type of headset may behave different that a Bluetooth music headset. Anyway, pressing the button seems to generate…
4
votes
1 answer

How to Implement Floating SearchWidget Android

I am trying to implement the search widget in the current android apps, but just can't get it done and I've not been able to implement it. Below is my code MainActivity @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the…
Tonespy
  • 3,257
  • 7
  • 26
  • 52
4
votes
2 answers

Search View Icon Position Change

I have implemented a SearchView in a toolbar as shown in image below. Here, the search icon is on the right side of a cursor . And it gets invisible with the hint. I want to shift the search icon on the left side of a cursor and also it should not…
4
votes
3 answers

Android search functionality using listview from JSON file(Hard )

1.My search functionality works fine using edittext,but for example if I type "1" than delete it the listview shows null,how can I make listview shows JSON again after I type something then delete it? 2.If I change to search COUNTRY rather than RANK…
Jason Wang
  • 53
  • 1
  • 6
4
votes
1 answer

Is global search in android still available for developer?

I'm stuck for adding global search to my app. I did everything that I should do. my question is is global search is still available for developer? I read somewhere that Google replaced it with index. Thank you for your time and help
4
votes
1 answer

Android SearchView: What is the difference between setOnFocusChangeListener() and setOnQueryTextFocusChangeListener?

From the reference docs, SearchView.setOnQueryTextFocusChangeListener - Sets a listener to inform when the focus of the query text field changes. and View.setOnFocusChangeListener - Register a callback to be invoked when focus of this view…
Solace
  • 8,612
  • 22
  • 95
  • 183
4
votes
1 answer

Properly displaying SearchView suggestions

I've recently added a SearchView to my application (The one provided in support-v7 library). In my case the submit button should never start a new Intent with ACTION_SEARCH, I just want to show a list of suggestions that the user can browse and…
Vektor88
  • 4,841
  • 11
  • 59
  • 111
4
votes
4 answers

After searching for ListView items in Android, always open first item of ListView (Issue)

When I opened the searched item, it is opening the first item of ListView not the searched one. Even if search and find the items successfuly. Let me give examples: If I search for Arrow, I can get the Arrow but when clicked Arrow it is going to…
Farukest
  • 1,498
  • 21
  • 39
4
votes
0 answers

Add autocomplete to search view and search results activity

I'm following this tutorial to create the search view on my Android app, however I need to add the autocomplete feature to this search view using the search results activity instead of the dropdown list that people usually suggest on blogs and here…
juliano.net
  • 7,982
  • 13
  • 70
  • 164
4
votes
1 answer

Android SearchView: styling suggestions list

I have problems to style the suggestions list from a ActionBar SearchView (support v7). Which style attribute I have to style to change the background and text color? Ralph
Ralph Bergmann
  • 3,015
  • 4
  • 30
  • 61
4
votes
1 answer

Execute search from action bar

I have successfully gotten my action bar to show up right in android. I am now trying to implement the search. I am trying to start small and at least see if I can get the search term before I try and do anything with it. I followed this tutorial…
Mike
  • 6,751
  • 23
  • 75
  • 132