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
2
votes
0 answers

Android - Up and down navigation buttons on expanding the Search widget

I am building a chat application just like Whatsapp. I have build the search functionality successfully in my application using the SearchView in the ActionBar. This is what I have done so far: Instead of this I want the SearchView with navigation…
Sibtain
  • 1,436
  • 21
  • 39
2
votes
1 answer

search in toolbar vs actionbar

Update: I am updating this post to make it easier to follow. I just updated my app to use Toolbar vs action bar. I have an activity MainDrawer2 which holds all the fragments loaded from the nav drawer. At the top I have a toolbar that I inflate with…
Mike
  • 6,751
  • 23
  • 75
  • 132
2
votes
2 answers

How to configure searchable activity when applicationId differs from package id?

I've changed applicationId and after that search functionality in my application stopped working. I initiate search via: activity.onSearchRequested(); Essential part of AndroidManifest.xml:
Andrey Novikov
  • 5,563
  • 5
  • 30
  • 51
2
votes
3 answers

Appcompatv7 search widget crashes app

I have implemented Appcompat V7 Search Widget successfully. while Debugging app on phone it shows no problem.(on many phones I tried) But when I export signed application. after installing and opening that activity crashes. Showing error in…
akshay bhange
  • 2,320
  • 2
  • 28
  • 46
2
votes
2 answers

Search intent not received by current activity

I am implementing an activity where I want to add a search bar. I want the current activity to receive the intent back. I followed couple of examples available and have added following code in my application: AndroidManifest.xml
Keya
  • 859
  • 3
  • 9
  • 17
2
votes
2 answers

Catch Click Event on UP icon for SearchView in Android.

I have implemented SearchView on my ListView. When i enter some text in EditText of this search widget, it filters the contents in my list. But if i close this search widget on clicking UP/home icon without clearing the text in EditText, i am still…
Aleena
  • 273
  • 4
  • 12
2
votes
1 answer

ActionbarSherlock SearchView not close in onCloseListener

I have implemented onCloseListener of SearchView. I want to close SearchView Programmatically that i have done using following code. but its not working for me. If i use searchView.setIconified(true); for closing searchView after updating data, run…
2
votes
2 answers

Android: Search widget clearFocus() not working

I have a search widget on my actionbar but my problem is that when I get back from the result activity the widget is still open. I want it to return on the initial state before I clicked on the actionbar button. I tried on the onSaveInstanceState of…
billiout
  • 695
  • 1
  • 8
  • 22
2
votes
2 answers

getFilter() and custom listview - Android

I have two questions. They are related and hence I am asking them together. Q1 : getFilter() method in custom BaseAdapter class not working I am using a custom BaseAdapter class in my app to implement search functionality in a custom listview. There…
2
votes
2 answers

how to implements getFilter for customAdapter android

i have implemneted search functionality for custom adapter but stil is not working, i have posted my code if anything wrong correct me. java code @Override public Filter getFilter() { /** * A filter object which will filter…
venu
  • 2,971
  • 6
  • 40
  • 59
2
votes
2 answers

Search view border color change and search hint icon change

How to change the Android searchview border color and searchview hint icon?
venu
  • 2,971
  • 6
  • 40
  • 59
2
votes
4 answers

Search Contact By Name

I am trying to create a Custom Contact app which displays only those contacts that have Contact Number. First of all, is there any automated way to do it? Suppose not, then I am trying to search a contact by its name e.g. Rohan. Here is the code…
Rohan Kandwal
  • 9,112
  • 8
  • 74
  • 107
2
votes
2 answers

Why doesnt collapseActionView() close SearchView

I have an Android application that employs an ActionBar SearchView Everything works fine when requesting a search, the search icon expands to allow text entry, the softkeyboard appears, i enter a query string and this is passed to my designated…
Hector
  • 4,016
  • 21
  • 112
  • 211
2
votes
2 answers

Don´t launch a new Activity when selecting a search suggestion Android

I'm developing an android app, and I've been watching some examples from the sdk, in particular the Dictionary example. The problem is that all this examples launch a new activity when a search suggestion is selected. The way my app works, that is…
danielrvt-sgb
  • 1,118
  • 5
  • 17
  • 33
2
votes
3 answers

search items in database and display dropdown list

I have the following app architecture (generalized for simplification): main Layout consists of ActionBar with custom View and scrollable Tabs, and a ViewPager hosting multiple ListFragments. Each ListFragment has its own set of data (1 row =…
Droidman
  • 11,485
  • 17
  • 93
  • 141