Solved

How to search data on a screen in Android

Posted on 2011-03-18
5
794 Views
Last Modified: 2012-05-11
Hey,

       I was wondering if there was a "SearchView" on the Android, common logic says yes... mainly because it was built by Google... but I haven't found anything called "SearchView", is it called something else? Or is there a widget we can put in our app to do the same thing?

Appreciate any help on this!
0
Comment
Question by:errang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 35165831

Actually, there is a class called SearchView:

http://developer.android.com/reference/android/widget/SearchView.html

Is that what you were looking for?
0
 

Author Comment

by:errang
ID: 35166877
Hm... Yea, so is this implemented only on the java side? Or are there any XML elements I need to worry about?
0
 
LVL 17

Accepted Solution

by:
Dejan Pažin earned 500 total points
ID: 35167328

Depends on how you work with gui. Personally, I define everything in the Java code, but thats just because thats how I like it. Google propagates defining gui elements in the xml layout files.

I simply find it easier and more productive by defining them in Java code.
0
 

Author Closing Comment

by:errang
ID: 35169912
Could you please give me a little hello world snippet? Even if its pseudocode?
0
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 35170484

The best place to see the demo code are samples provided by Google. You should follow the tutorial on how to get the samples here:

http://d.android.com/resources/samples/get.html

That's exactly how I learned Android programming, the samples are actually very good. There are some examples on SearchView:

http://d.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/SearchViewFilterMode.html
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
There is a lot to be said for protecting yourself and your accounts with 2 factor authentication.  I found to my own chagrin, that there is a big downside as well.
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question