Custom android preference type loses focus when typing
<p>I created a simple preference class that shows an AutoCompleteTextView control and it displays properly but when i focus on the AutoCompleteTextView and start typing it brings up the keyboard but then immediately loses focus on the control. </p>

<p>Any idea why this loses focus? </p>

<p>Here's what i did to create the view. the inflated layout is just a basic linear layout with a title textview in it.</p>

<p>I could change it to a dialog preference instead I guess but it'd be smoother if it could be part of the base view.</p>

<pre><code>@Override
protected View onCreateView(ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.base_preference, null);

    if (mHint != null) {
        TextView hintView = (TextView) layout.findViewById(R.id.PreferenceHintTextView);
        hintView.setText(mHint);
    }

    TextView titleView = (TextView) layout.findViewById(R.id.PreferenceTitleTextView);
    titleView.setText(getTitle());

    AutoCompleteTextView inputView = new AutoCompleteTextView(getContext());
    inputView.setGravity(Gravity.FILL_HORIZONTAL);

    ArrayAdapter&lt;CharSequence&gt; adapter = new ArrayAdapter&lt;CharSequence&gt;(getContext(),
            R.layout.auto_complete_text_list_item,
            getEntries());

    inputView.setAdapter(adapter);
    inputView.setThreshold(1);
    inputView.setOnItemSelectedListener(this);
    layout.addView(inputView);

    return layout;
}
</code></pre>

<p>The list item is:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dp"
    android:textSize="16sp"
    android:textColor="#000"&gt;
&lt;/TextView&gt;
</code></pre>

<p>could've probably been the standard list item and come out identical.</p>
