0

I was trying to use search View in my application but it showed an error i.e View require API level 11(current minimum is 8). Is there any method through which i can use this search view by keeping min API level to 8 only?

If there then provide a small code snippet. Thanks

ngrashia
  • 9,869
  • 5
  • 43
  • 58
Vishal
  • 7
  • 9

5 Answers5

2

As you can see in the documentation, the SearchView is added in API level 11. If you want to use it below that, use the Support Library: https://developer.android.com/reference/android/support/v7/widget/SearchView.html

See also this post.

Community
  • 1
  • 1
Blacklight
  • 3,809
  • 2
  • 33
  • 39
0

The entire searchview code is available here with Minimum Required SDK : API 8 : Android 2.2 ( Froyo )

ngrashia
  • 9,869
  • 5
  • 43
  • 58
0

you can use the support library of API 11 and include it in your project in order to use it's components.

Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118
0

you can use sherlock action bar lib.for do this task please refer this link.. How to implement search widget in Action Bar Sherlock?

Community
  • 1
  • 1
Sachin C
  • 141
  • 9
0

You can use the v7 appcompat library for a backwards compatible SearchView. You should prefer this library over action bar sherlock, as the former is Google's own implementation and I believe action bar sherlock is no longer being actively maintained.

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250