Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Updated 15 December 2016
Searching in android is a very important feature and mostly present in every application nowadays. There are two ways to provide the search one is search widget and the other is or a search dailog.
We can also show the suggestions to user in the search view. The suggestions can be the recent search items or the custom suggestions you added in your application.
Here we will implement a search dialog with the recently searched terms as sugessions. Firstly we have to implement a searchable configuration. Here is your searchable.xml
Place this xml at res/xml folder of your application.
Now make a search activity that will be called internally when a search is performed. The activity should be single top. Lets call it SearchActivity
To make the system know which one of your activity is search activity. So define your search activity within th manifest as
Now to store your recent searches for suggestion make a authority provider as we have already defined in Searchable.xml i.e MySuggestionProvider
You can also use DATYABASE_MODE_2LINES, it is helpful in showing a descriptive text below your suggestion text. The search is matched with both the suggestion text as well as descriptive text.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.