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

Getting NullPointerException in searchview on action bar

I am working on an application in which i am setting SearchView widget on the action bar. But i am always getting null pointer exception . I am not getting any idea why it's happening. I followed Many SO post but none of them are helping. Please…
anand
  • 1,711
  • 2
  • 24
  • 59
0
votes
2 answers

Android button auto-fill search field

how can I create in my android app a button that will automatically put the search suggestion into the search bar, so that when you click on the button, the search bar will be automatically filled with the corresponding text? An example is shown in…
user2340612
  • 10,053
  • 4
  • 41
  • 66
0
votes
2 answers

Action Bar search - Not working.

I am trying to implement an Action bar search on a listview which is nested inside a Fragment. For now I am just trying to print the search text onto console, but its not working. Following is my code: main.xml:
User3
  • 2,465
  • 8
  • 41
  • 84
0
votes
0 answers

Android searchview add a parameter in the onQueryTextChange method

I need to pass a parameter in the "onQueryTextChange" method, like I did in the LoadMoreTask, the "npagina" is an Integer... parameters, I need to do the same in the "onQueryTextChange", but it doesn't let me, because of the "OnQueryTextListener"…
0
votes
1 answer

Android searchview adding rows to the listview

I'm facing an odd situation here, when I search for an item it returns me what I'm searching for, but it is doing something else too, it is adding 2 empty rows to the listview by each character pressed on the search, if I search for example: "fire"…
AND4011002849
  • 1,971
  • 8
  • 38
  • 81
0
votes
2 answers

Android: finish activity when perform a search on SearchView

I have a simple searchview to perfom search functions and but I want when someone search something to finish the current activity where the searchview is placed and add and a Transition effect and then open the activity with the results. But I can't…
user3907002
  • 375
  • 1
  • 4
  • 17
0
votes
1 answer

How to get Up Event in SearchView android

I need to implement some action after clicking the up icon after searching in my ListView via SearchView. How can i get UP event, i.e. how can i implement the click event for UP icon.
BST Kaal
  • 2,993
  • 6
  • 34
  • 52
0
votes
0 answers

Adding an EditText to a LinearLayout with ListView programmatically (android)

I'm making a simple android app and I reached a problem I can't solve myself. I searched for a solution quite thoroughly but nothing that I have found seems to work. In my Main Activity I have a ListView which stores data provided by the user. I…
0
votes
2 answers

Layout inflating again and again on Searching

I have one Fragment DefaultMapFragment which extends Fragment where I'm inflating my layout. This Fragment is inside an Activity ActivityMain.When I do search it seaches in a Activity so layout inflation happens again and again. Here's my code to…
Pankaj
  • 2,115
  • 2
  • 19
  • 39
0
votes
2 answers

How to add TextWatcher to Search Widget

I want to have a 'live' search using the Android Search Widget. In other words, for each letter the user types I want a search to be performed. I know I will be using AsyncTask to retrieve the results, but I am unsure how to get the continuous…
Daiwik Daarun
  • 3,804
  • 7
  • 33
  • 60
0
votes
1 answer

How to change theme in android programatically

i'm using actionbarsherlock for Actionbar, here by default a theme will be set. Upon expansion of searchview i need to change the theme of my actionbar, i'm doing like below @Override public boolean onMenuItemActionExpand(MenuItem item) { //…
Naruto
  • 9,476
  • 37
  • 118
  • 201
0
votes
2 answers

How to change the up navigation icon in android on searchview expand

i'm using actionbarsherlock for my actionbar. I have a sliding menu and searchview. when the application get launches, it will automatically pick the up navigation icon from style.xml file. When the search menu gets expanded, the up navigation icon…
Naruto
  • 9,476
  • 37
  • 118
  • 201
0
votes
1 answer

unfortunately program has stopped

I am making a simple list view with search in android studio. I have created this class: Success.java public class Success extends Activity { protected String[] plates = {"AA 367 AM", "AA 367 AL","AA 367 AK"}; protected ListAdapter adapter; …
user3660185
0
votes
1 answer

How to write search key event for edittext inside drawer layout?

Hi iam doing an application in that i have navigation drawer. Inside the navigation drawer i am an edittext above the listview for search. Now i want to write android keyboard search key event for that edittext. iused …
0
votes
2 answers

How i can have a filtered item on a listview with constant item position?

How i can have a listView with constant item position ? Suppose you have a listview with a searchbox on actionbar. Now you want to filter the results and also want the position number of the item to be constant even after filtering. The below code…
A.A
  • 1,138
  • 1
  • 16
  • 29