Android:Quick Search Box - Adding Custom Suggestions - android

I am a newbie to android and trying to implement Quick Search Dialog for my application.
Actually, in my application I have an activity
1. where I have a Edit text and Search Button next to it
2. Add Button and a Employee Table below it.
Whenever the user enters the search string in the EditText and clicks the Search button , I am calling the Quick Search Box and luckily it opens with the Search and here the user can see the given search query.
Till this, every thing works perfectly as I want.
But what I want is:
On-Clicking the Search button,the search query is displayed in the QSB and what I want is to display custom suggestions based on the search query and selecting the valid data , it should be saved in the Employee table.
Now I want Custom Suggestions to be displayed in a list view based on the search query.
How do I proceed to achieve this.
Please provide links for Quick search Box custom suggestions also.
Thanks and Regards,
Fazal Ahamed B

This is described here: http://developer.android.com/guide/topics/search/adding-custom-suggestions.html

Related

ANDROID autoCompleteView suggestions

I want to show suggestions not only as starting character but also a containing character... means 's' suggestions should be like tags,pas,also, and so on.
#sagar jagdale :
You can use Android AutoCompleteTextView.
It provides suggestions automatically when the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.
Check Demo Android AutoCompleteTextView Example

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 the image below.
Have you looked into AutoCompleteTextView? From the docs:
The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.
EDIT: If you're using a SearchView, the process is much different. Assuming you've already set up the SearchView, you have to provide search suggestions that the system will display as the user types. These can be recent query suggestions or custom search suggestions.
There are several steps involved, but in a nutshell, you will have to create a Content Provider that takes a search query and serves up a list of suggestions (details here). Once you've done this, you can configure your search bar to fill itself in when the user selects a suggestion (details here).
Hope this helps!
The solution is to call setQueryRefinementEnabled(true) on the SearchView object

Integrating Google search to an Android EditText

Even a Snippet of an android code to Integrate Google Search into an Edit text will be really useful, according to my requirement i don't want the google search data or whatever but only the dropdown so that it will b easier for people to type and don't have to waste time :)
You can see about the componenent is AutoCompleteTextView
An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.

Android SearchView: redirect to another search activity

I have a SearchView (support v7) with custom suggestions. Everything works fine.
But now I want to redirect to another search activity depending on the selected suggestion.
The custom suggestion table contains suggestions and search matches. And when ever the user clicks on a match I want to show the data without the search (because it is a match, no search is needed)
Currently I use the SUGGEST_COLUMN_INTENT_ACTION in the search activity to open the other activity. It works but is this the best way to do this?
Ralph

How can implement search bar in android?

I am working in android. i am trying to display name of university using listView.
my list view is looking like this.
Now i want to add a search bar on the top of this list view. if i press A in search bar then this list view should display all the name of university start with A, if i press some other character then according university name must be displayed.
Please tell me how can implement this. Is any way to make search bar in android. I have seen in iPhone, it works very efficiently in iPhone. Please help me how can make this search bar ?
Thank you in advance...
This may be the long way. but this is just an idea..
I think you have to create a layout xml file with one EditText and ListView. Inside activity you have to listen for textChange in EditText and then probably you have to filter your ListAdapterbased on the text entered by the user and bind it with ListView.
See the complete example here : http://www.androidpeople.com/android-listview-searchbox-sort-items
You can use setTextFilterEnabled(true) on your list view.
I think this may help you to get an idea. http://developer.android.com/resources/tutorials/views/hello-autocomplete.html

Categories

Resources