title: Focus not working as expected in ListView
body: <p>I am developing an accessible app. For this purpose it is important that all elements of the interface can obtain the focus correctly, so that they can be read by Talckback.
  I build a <code>PreferenceActivity</code> with a <code>ListView</code> inside, like in this question <a href="https://stackoverflow.com/questions/9604242/preference-list-only-shows-first-element/9885268#comment12620104_9885268">Preference List only shows first element</a>  </p>
  
  <p>It works perfect in touch mode, but when I try to access to the <code>ListView</code> with the Talckback activated (It's like I try to get Focused the <code>ListView</code>), It doesn't work like I expected. I want the children of the list get the focus, not the entire list gets the focus. </p>
  
  <p><img src="https://i.stack.imgur.com/2BH8V.png" alt="enter image description here"><img src="https://i.stack.imgur.com/9wb4n.png" alt="enter image description here"></p>
  
  <p><br>I have an additional problem, the two <code>ListViews</code> inside my <code>PreferenceActivity</code> has scroll, and the scroll is not working right. Can I make the <code>ListView</code> no scrollable?</p>
  
  <p>Thanks</p>
  
  <p>Code:</p>
  
  <p>ListPreferences.java (Custom ListView)</p>
  
  <pre><code>import com.battleship.R;
  
  import android.content.Context;
  import android.content.SharedPreferences;
  import android.preference.Preference;
  import android.util.AttributeSet;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.view.ViewGroup.OnHierarchyChangeListener;
  import android.widget.ArrayAdapter;
  import android.widget.LinearLayout;
  import android.widget.ListView;
  import android.widget.RadioButton;
  import android.widget.RadioGroup;
  import android.widget.RadioGroup.OnCheckedChangeListener;
  import android.widget.Toast;
  
  public class ListPreferences extends Preference implements
          OnCheckedChangeListener, OnHierarchyChangeListener {
  
      private ListView listView;
      private View thisView;
      private int listHeight = 0;
  
      public ListPreferences(Context context) {
          super(context);
      }
  
      public ListPreferences(Context context, AttributeSet attrs) {
          super(context, attrs);
      }
  
      public ListPreferences(Context context, AttributeSet attrs, int defStyle) {
          super(context, attrs, defStyle);
      }
  
      @Override
      protected void onClick() {
  
          super.onClick();
          Toast t = Toast.makeText(getContext(), "HOLA!", 3);
          t.show();
      }
  
      @Override
      protected View onCreateView(ViewGroup parent) {
  
          this.setLayoutResource(R.layout.listview_preference_layout);
          thisView = super.onCreateView(parent);
          listView = (ListView) thisView.findViewById(android.R.id.list);
          listView.setOnHierarchyChangeListener(this);
  
          String[] contentString = new String[3];
          if (getKey().equals("theme")) {
              contentString = new String[] {
                      (getContext().getString(R.string.settings_theme_default)),
                      (getContext().getString(R.string.settings_theme_black)),
                      (getContext().getString(R.string.settings_theme_white)) };
          } else {
              contentString = new String[] {
                      (getContext().getString(R.string.settings_font_big)),
                      (getContext().getString(R.string.settings_font_medium)),
                      (getContext().getString(R.string.settings_font_little)) };
          }
  
          ArrayAdapter&lt;String&gt; array = new ArrayAdapter&lt;String&gt;(getContext(),
                  android.R.layout.simple_list_item_single_choice,
                  android.R.id.text1, contentString);
              listView.setAdapter(array);
              listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
              listView.setFocusable(false);
              listView.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
              return thisView;    
  
      }
  
  
  
  
  
      private void updatePreference(int intRadio) {
          SharedPreferences.Editor editor = getEditor();
          editor.putInt(getKey(), intRadio);
          editor.commit();
      }
  
      @Override
      public void onCheckedChanged(RadioGroup group, int checkedId) {
          updatePreference(checkedId);
          notifyChanged();
      }
  
      @Override
      public void onChildViewAdded(View parent, View child) {
          int childHeight = child.getMeasuredHeight();
          if(childHeight &gt; 0)
          {
              listHeight = listView.getAdapter().getCount() * childHeight;
              thisView.setMinimumHeight(listHeight);
              Log.i("LISTA","onChildViewAdded, done: "+listHeight+" "+childHeight);
          }
      }
  
      public void onChildViewRemoved(View parent, View child) {
      }
  
  }
  </code></pre>
  
  <p>preference.xml (xml of PreferenceActivity)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;PreferenceCategory
          android:key="player_settings"
          android:title="@string/settings_player_config" &gt;
          &lt;EditTextPreference
              android:defaultValue="@string/settings_player_default_name"
              android:dialogMessage="@string/settings_player_summary"
              android:dialogTitle="@string/settings_playersname"
              android:key="player_name"
              android:summary="@string/settings_player_summary"
              android:title="@string/settings_playersname" /&gt;
      &lt;/PreferenceCategory&gt;
      &lt;PreferenceCategory
          android:key="volume"
          android:title="@string/settings_volume" &gt;
          &lt;com.battleship.preferences.SeekBarPreferences
              android:defaultValue="50"
              android:key="volume"
              android:title="@string/settings_volume" /&gt;
      &lt;/PreferenceCategory&gt;
      &lt;PreferenceCategory
          android:key="shine"
          android:title="@string/settings_shine" &gt;
          &lt;com.battleship.preferences.SeekBarPreferences
              android:defaultValue="50"
              android:key="shine"
              android:title="@string/settings_shine" /&gt;
      &lt;/PreferenceCategory&gt;
      &lt;PreferenceCategory
          android:key="themeTitle"
          android:title="@string/settings_group_themes" &gt;
          &lt;com.battleship.preferences.ListPreferences android:key="theme" /&gt;
      &lt;/PreferenceCategory&gt;
      &lt;PreferenceCategory
          android:key="fontsTitle"
          android:title="@string/settings_group_font_size" &gt;
          &lt;com.battleship.preferences.ListPreferences android:key="font" /&gt;
      &lt;/PreferenceCategory&gt;
  
  &lt;/PreferenceScreen&gt;
  </code></pre>
  
  <p>SettingsActivity.java (PreferenceActivity)</p>
  
  <pre><code>package com.battleship;
  import com.battleship.R;
  import android.os.Bundle;
  import android.preference.PreferenceActivity;
  import android.util.Log;
  import android.view.MotionEvent;
  import android.view.View;
  
  public class SettingsActivity extends PreferenceActivity {
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          addPreferencesFromResource(R.xml.preferences);
      }
      @Override
      public View getCurrentFocus() {
          Log.d("FOCO", "" + super.getCurrentFocus());
          return super.getCurrentFocus();
      }
      @Override
      public boolean onTrackballEvent(MotionEvent event) {
          Log.d("TRACKBALL", "" + event);
          return super.onTrackballEvent(event);
      }
  
  }
  </code></pre>