2
votes

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?

2

2 Answers

4
votes
0
votes

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