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
7
votes
3 answers

How I Can make Scrolling toolbar with search box like amazone

Hi I want to make scrollable toolbar with searchbox. on scrolling toolbar should be hide toolbar and show search box. Give me some suggestion that how i can build this kind of UI for my application. Here i want something like this. Here i am…
7
votes
4 answers

Android SearchView customisation

im new to android and i got stucked on something that i think it's simple but i got confused.. I need to make a custom searchView not in the actionbar/toolbar but in my Relativelayout. The problem is that i don't know hot to customise the…
user5807086
7
votes
2 answers

Passing searching data to Searchable Activity

I have a main activity which has 2 fragments. The main activity has a SearchView in the action bar. Both the fragments have a list of large number of strings, List. The flow is: User enters Fragment I --> Selects a string (lets say…
7
votes
3 answers

android Search Interface - how to remove app icon when onSearchRequested() called

On MainActivity.class, i call a search dialog by onSearchRequested(). That how it shows up as image above. I want to removed that home/app icon but no luck. Please don't confuse that i want to removed home/app icon on action bar. No, this is a…
laph
  • 2,925
  • 2
  • 18
  • 18
6
votes
2 answers

Android Google Search Bar with Drawer

My app is currently implemented with the Single activity approach (Using navigation architecture component with one main activity and several fragments). I am currently using a toolbar with a drawer. My app currently look like this: However in the…
6
votes
2 answers

Search Edit Text like Google Play

How to implement Search Edit text like Google play with Back and Cancel button on Right at place of Voice search and suggestions list should display below the complete edit text layout.
6
votes
1 answer

Android assisted Search: The search button does not invoke the searchable Activity (Other Solutions did not help)

I wrote this small test application to demonstrate the problem, that is the searchable activity is not started when the user presses the search button on the keyboard. I have been following the developer guides, but from my web search, it turns out…
Solace
  • 8,612
  • 22
  • 95
  • 183
5
votes
1 answer

AutoCompleteTextView weird cropping issue on cut/copy/paste menu when onLongClick

I have a problem on showing cut/copy/paste menu. After you've written a String in AutoCompleteTextView, in the first selection (LongClick) of the word opening cut/copy/paste menu. Unfortunately this menu is dislocated from its original place. The…
5
votes
5 answers

Respond Keyboard while Updating UI

I am Using android.support.v7.widget.SearchView and I am performing Search on enter of every character in SearchView. following is the snippet. searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { …
GreenROBO
  • 4,725
  • 4
  • 23
  • 43
5
votes
1 answer

Android appcompat API 10 collapse action view

I'm currently developing and Android app that needs to support Api10+ I followed many tutorials to set appcompat to manage to create the action bar. links like:…
5
votes
2 answers

How to show Android Google default search results in webview?

I want to display default Google search Results in webview of my Android application. We can do it using Google Custom Search API but it is paid. I want to use Google default search engine to replace the API. Could you please help me to provide its…
Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
5
votes
1 answer

Create a Google like instant search in an Android app

I am working on an Android app in which i want to add an instant search feature. Basically I want to show places name when the user writes its initials in a TextBox. How can I achieve this?
4
votes
0 answers

SearchView suggestions: SearchView.OnQueryTextListener vs custom content provider (android:searchSuggestAuthority)

I am trying to implement my first SearchView with suggestions. As far as I understand, I have two possibilities to provide suggestions: In the searchable.xml configure a custom content provider using android:searchSuggestAuthority which is then…
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
4
votes
0 answers

Should one use androidx.appcompat.widget.SearchView or android.widget.SearchView?

I am confused which version of SearchView I should use. The documentation for androidx.appcompat.widget.SearchView clearly states If you're developing your app for API level 11 and higher only, you should instead use the framework…
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
4
votes
1 answer

Android: Tabs and searchbars

I have two tabs and each tabs has its own searchbar. I bind the searchbar in onCreateOptionsMenu. However, the searchbars only work if I leave the screen once and return to the screen (meaning it needs one more lifecycle for the searchbars to…
Josip Domazet
  • 2,246
  • 2
  • 14
  • 37
1 2
3
27 28