4

I have an ExpandableListView which contains a RecyclerView of a custom layout. This layout contains some views including my EditText.

My behavior is : When I click in my number EditText, the keyboard appears for about 0.5s, the whole layout is cleared with default values, then the keyboard disappears, a text EditText appears, and finally I loose focus. When I click on it one more time, the keyboard stays, but in text type. Strange thing : the problem seems to be only on devices where the whole layout overflows the screen because on 10" tablet, everything is ok (layout not cleared, and keyboard not disappearing).

According to me, when I get the focus in the EditText, the layout is re-creates , making it to be cleared.

I tried a long time to figure out what was going on, but I didn't find anything. Here is the things I tried, but didn't change anything :

android:descendantFocusability="beforeDescendants" // on all parent of the EditText

focusable="true" // On the EditText

android:windowSoftInputMode="adjustPan" // In the activity in the manifest

making all the ViewHolder attributes final

As the code is very huge for all that amount of things, I don't know what I should post to help. So don't hesitate to ask anything if it can help

Thanks!

EDIT : A Gif showing the issue https://i.stack.imgur.com/CqfiV.jpg

thomas_exotic
  • 211
  • 1
  • 7

1 Answers1

0

Try adding this line to your activity on manifest.xml:

android:configChanges="keyboardHidden|screenSize"

Opening keyboard or screen size changes may trigger to re-create your content.

Oğuzhan Döngül
  • 7,856
  • 4
  • 38
  • 52