0

I have an EditText and have a hint. When I tap on the EditText, the keyboard appears, though, as I type neither the hint goes away nor my typing goes into view. It's like my input is going to /dev/null. My EditText is inside a ListView cell, if it helps. Here is my layout:

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:background="#00000000"
    android:id="@+id/aboutView"
    android:layout_gravity="center_horizontal|bottom"
    android:layout_centerHorizontal="true"
    android:layout_below="@+id/headerFrame"
    android:layout_marginTop="12dp"
    android:gravity="center"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:textSize="14dp"
    android:layout_marginBottom="12dp"
    android:hint="Tell something about yourself..." />

Why can this be?

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
  • Is the EditText getting the focus? I.e. is the blinking cursor appearing? – Msk Apr 15 '15 at 17:25
  • show the code xml got nothing to do with it – silverFoxA Apr 15 '15 at 18:00
  • Please show the code and give us some information on the device you tested it. Have you tried different devices and/or emulator images? – dbaelz Apr 15 '15 at 18:03
  • @Msk well, it does get focus (the cursor initially displays, BUT then it disappears), the keyboard pops up (and it stays displayed even when cursor goes away too). Sometimes the cursor stays, and sometimes (very rarely) I can even type correctly. The seemingly-random occurance of the problem makes it difficult for me to explain. – Can Poyrazoğlu Apr 15 '15 at 19:29

1 Answers1

0

Found the solution here: EditText in Listview loses focus when pressed on Android 4.x

I don't know the exact reason, but I wasn't the only one suffering from EditText focus problems when inside a ListView. I've added android:windowSoftInputMode="adjustPan" to my activity in manifest file and the problem went away.

Community
  • 1
  • 1
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389