2

I have edit text items in RecyclerView. Everything works fine except in API 28. When it comes to testing in Android Pie devices, a single tap on an edit text item of a RecyclerView opens up the soft input keyboard but then the edit text loses the focus immediately and hence we are required to tap again on that edit text. Once we tap again on that edit text, it works as usual. But it is weird. Generally, edit text sustains the focus on the very first tap.

I have tried following solutions with no success

https://radhedubey.wordpress.com/2014/08/24/android-listview-with-edittext-loses-focus-when-the-keyboard-displays/

http://androidtechnicalblog.blogspot.com/2014/04/quick-trick-of-week-edittext-inside.html?m=1

Sagar Patel
  • 506
  • 1
  • 8
  • 23
  • 1
    Accepted answer is the only workaround I have found working so far https://stackoverflow.com/questions/20406472/edittext-in-listview-loses-focus-when-pressed-on-android-4-x – Sagar Patel May 31 '19 at 15:48
  • 1
    Please note that in addition to mentioned workaround, I had to add onTouchListener with same approach too! And finally, it seems working! – Sagar Patel Jun 08 '19 at 03:25
  • Use targetSdkVersion 27 instead of 28 or 29 and it should solve your problem – Sagar Patel Sep 04 '19 at 08:18

1 Answers1

0

Use targetSdkVersion 27 instead of 28 or 29.

Sagar Patel
  • 506
  • 1
  • 8
  • 23