Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 800
  • Last Modified:

How to search data on a screen in Android

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
errang
Asked:
errang
  • 3
  • 2
1 Solution
 
Dejan PažinCommented:

Actually, there is a class called SearchView:

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

Is that what you were looking for?
0
 
errangAuthor Commented:
Hm... Yea, so is this implemented only on the java side? Or are there any XML elements I need to worry about?
0
 
Dejan PažinCommented:

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
 
errangAuthor Commented:
Could you please give me a little hello world snippet? Even if its pseudocode?
0
 
Dejan PažinCommented:

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now