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

SearchView does not trigger SearchActivity

I am having trouble making my SearchView in the ActionBar trigger an intent that is received by my SearchActivity. I think the issue is in the Manifest/XML somewhere, because the logcat isn't even showing the log in the onCreate method of the…
Gus W
  • 128
  • 11
1
vote
0 answers

Search View (widget) broken when use backButton

I've created a search view using search widget, and when I open and search it works normally, the problem is when I go to any activity, including the searchview activity, and back using backbutton or finish() the activity, the search widget stops…
Adley
  • 511
  • 1
  • 6
  • 19
1
vote
0 answers

Different Searchable configuration for each fragment (Android)

I have an Activity (MainActivity) with a Navigation Drawer, and i change the main container with the appropriete Fragment every time a section (lets say i have tow: Tags and channels) is selected. I want to add a custom Search activity for each…
1
vote
1 answer

Trouble setting up search view in android

I am following the docs on how to set up the UI to use the search view in android. I have literally copied and pasted from them and I get a java.lang.NullPointerException. Stacktrace: java.lang.NullPointerException: Attempt to invoke virtual method…
Tom Finet
  • 2,056
  • 6
  • 30
  • 54
1
vote
0 answers

How to search in External SQLite Database in android?

I'm developing a dictionary with an external database. I can show all of the words with RecyclerView, Adapter and the DBHelpr, but I have a problem with the search and query. I don't know how to create a search for it. There are 2 columns that I…
alison
  • 11
  • 5
1
vote
1 answer

foreigns key in android fts4 tables

I have the following sql tables Parent(_id,name) Kid(_id,name,parent_id)//where parent_id is foreign key Toy(_id,name,…,kid_id)//where kid_id is foreign key right now I have queries that get all the Kids of a given Parent and also all the Toys for a…
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199
1
vote
1 answer

Which method is called when query-text changes in SearchView, while both Search suggestions and OnQueryTextListener interface are implemented?

In the Android Documentation, in topic 'Adding Custom Suggestions' for Search feature, it says that: When the user starts typing into the search dialog or search widget, the system queries your content provider for suggestions by calling query()…
user1906035
  • 133
  • 8
1
vote
0 answers

How can I set Search Bar in list view using custom adapter?

I want to add search bar in a list view using adapter class can anybody help me below is my code. this is adapter class that I am using. Cat_Headers_Home_Adapter.java public class Cat_Headers_Home_Adapter extends SectionAdapter { …
1
vote
1 answer

Handling on click listeners with custom suggestion item

I'm including a search view following the answer to this question. I've created a custom suggestion item which includes a text and an ImageButton. The important code is below: Filter Activity, in this class the search view is been initialize, and I…
Dani M
  • 1,173
  • 1
  • 15
  • 43
1
vote
0 answers
1
vote
1 answer

How to theme SearchView suggestions?

I am trying to theme the dialog which shows the "recent search" in the SearchView. I did go over this answer Toolbar Search Suggestions Theming however, is there any way to theme the suggestions without having to manually load the suggestions? …
An SO User
  • 24,612
  • 35
  • 133
  • 221
1
vote
1 answer

Animate search bar to toolbar android

I'm trying to build a search bar similar to Flipboard. This search bar animates from below the toolbar to cover the toolbar. This GIF shows it better than I can explain: Does anyone know if this is standard Material Design? And if so, are there any…
b.lyte
  • 6,518
  • 4
  • 40
  • 51
1
vote
1 answer

How to remove inner bottom space (bottom margin/padding) of text/layout inside a SearchView?

So I got this SearchView that has a default space at the bottom for the text inside it. How can I reduce it (see the red lines in picture):
1
vote
3 answers

Trouble when searching multiple data from mysql database in android

I am building an app in which I have a view with multiple tabs. Each tab contains a RecyclerView which gets populated from data in MySQL. So there is the Activity with the ViewPager and then each tab has its own Fragment. So I use the Interface to…
Kostas Drak
  • 3,222
  • 6
  • 28
  • 60
1
vote
1 answer

Changing AppCompat's SearchView colorAccent

I know this topic has been asked previously but most of the answers provide a programatic solution which is not very up to date. I have a SearchView inside Toolbar, I need to modify it's appearance a bit, here's my style file
Aviran
  • 5,160
  • 7
  • 44
  • 76