I have an ExpandableListView that contains a custom layout RecyclerView. This layout contains some views, including my EditText.
My behavior: when I click on my EditText number , the keyboard appears for about 0.5 s, the entire layout is cleared with default values, then the keyboard disappears, the text EditText appears, and finally I lose focus. When I click on it again, the keyboard remains, but in text type . The strange thing: the problem seems to be only on devices where the entire layout overflows the screen, because on a 10-inch tablet everything is fine (the layout does not clear, but the keyboard does not disappear).
In my opinion, when I get focus in EditText, the layout is recreated, making it cleaned up.
For a long time I tried to find out what was happening, but I did not find anything. Here is what I tried but didn't change anything:
android:descendantFocusability="beforeDescendants"
focusable="true"
android:windowSoftInputMode="adjustPan"
making all the ViewHolder attributes final
Since the code is very large for all of this, I don’t know what I should post to help. So feel free to ask something if it can help.
Thank!
EDIT: Gif showing the problem https://imgur.com/a/BPue4
source
share