title: EditText losing focus in ListView
body: <p>I already read tons of similar questions, but I found no solution that fixed my problem, so please do not mark this as duplicate.</p>
  
  <p>I have a <code>ListFragment</code> with a <code>FrameLayout</code> containing a <code>ListView</code>, populated through a <code>custom ArrayListAdapter</code>.
  Each row of the list has three elements:</p>
  
  <p><code>Checkbox</code>, <code>EditText</code> and <code>ImageButton</code>.</p>
  
  <p>My problem is that when I tap on an <code>EditText</code> to change the <code>string</code> it contains the keyboard shows up, but the focus immediately goes away and I'm not able to write.</p>
  
  <p>Please note that I already have added to my <code>Activity</code> in the <code>manifest</code> file</p>
  
  <blockquote>
    <p>android:windowSoftInputMode="adjustResize"</p>
  </blockquote>
  
  <p>even the</p>
  
  <blockquote>
    <p>android:descendantFocusability="afterDescendants"
    android:descendantFocusability="beforeDescendants"</p>
  </blockquote>
  
  <p>doesn't solve the problem.</p>
  
  <p>Here is my XML code:</p>
  
  <p>row_item.xml
  </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  &gt;
  
  &lt;CheckBox
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/item_checkbox"
      android:layout_alignParentLeft="true"
      android:layout_centerVertical="true"
      /&gt;
  
  &lt;EditText
      android:id="@+id/item_text"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:minHeight="60px"
      android:text="Test text"
      android:singleLine="true"
      android:layout_toRightOf="@id/item_checkbox"
      android:layout_centerVertical="true"
      android:layout_toLeftOf="@+id/item_important"
      android:layout_toStartOf="@+id/item_important" /&gt;
  
  &lt;ImageButton
      android:id="@+id/item_important"
      android:layout_width="20dip"
      android:layout_height="20dip"
      android:layout_alignParentRight="true"
      android:layout_centerVertical="true"
      android:layout_marginRight="10dp"
      android:visibility="visible"
      android:layout_marginLeft="10dp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>fragment_list.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingLeft="8dp"
      android:paddingRight="8dp"
      &gt;
  
      &lt;ListView android:id="@id/android:list"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
       /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>It would be great if you could suggest me some resource where to understand how focusability works in this case.</p>
  
  <p>Thank you</p>
  
  <hr>
  
  <p>UPDATE</p>
  
  <p>I found out the problem is created by the keyboard showing up: I guess the view recycling is the reason why the <code>EditText</code> loses focus.</p>