In Android Nougat, the EditText
loses focus when the keyboard is displayed. This is working fine with all the lower versions.
I am using requestFocus()
manually to get the focus to the EditText
and programmatically showing the keyboard. The EditText
is placed inside a ListView
.
Could someone help me to resolve the issue?
If you can replace ListView with RecyclierView easily, that would be my suggestion. It worked for me.
Try:
Add android:descendantFocusability="afterDescendants"
to your ListView
.
Add android:focusable="true"
and android:focusableInTouchMode="true"
to your EditText
.
Add android:windowSoftInputMode="adjustPan"
to your Activity
in AndroidManifest file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.