2

I'm getting an error after using this StackOverflow answer:

setSelectionFromTop() requires API level 21 (current min. is 10)

and When I checked android API, it was added in API Level 1. How can I solve it?

Community
  • 1
  • 1
Bassem Qoulta
  • 341
  • 1
  • 7
  • 17

2 Answers2

4

After some googling it seams that yeah, it's a bug...

https://code.google.com/p/android/issues/detail?id=172621

pelotasplus
  • 9,852
  • 1
  • 35
  • 37
0

As @pelotasplus says it's a bug and seems google still doesn't solve it till now. You can add @SuppressLint("NewApi") annotation to prevent lint check. See https://developer.android.com/studio/write/lint.html#src

HJWAJ
  • 170
  • 2
  • 10