title: setSelection not changing ListView position
body: <p>I am having some trouble with the ListView setSelection method. I am attempting to have my list view remain at the same index when switching between landscape and portrait orientation. However, every time I rotate and the activity is recreated, the listview starts at the top. The code I am using is as follows:</p>
  
  <pre><code>@Override
  public void onSaveInstanceState(Bundle savedInstanceState) {
      ArrayList&lt;Integer&gt; indices = new ArrayList&lt;Integer&gt;();
      for (Integer i : f_checkedMessages) {
          indices.add(i);
      }
      savedInstanceState.putIntegerArrayList("CheckedMessageIndices", indices);
      savedInstanceState.putInt("ListIndex", f_listView.getFirstVisiblePosition());
  }
  
  @Override
  public void onRestoreInstanceState(Bundle savedInstanceState) {
      ArrayList&lt;Integer&gt; indices = savedInstanceState.getIntegerArrayList("CheckedMessageIndices");
      for (Integer i : indices) {
          f_checkedMessages.add(i);
      }
      int listIndex = savedInstanceState.getInt("ListIndex");
      f_listView.setSelection(listIndex);
  }
  </code></pre>
  
  <p>I have used the debugger to verify that listIndex is the correct value. It should also be mentioned that the checked listview items persist when changing orientation. I know that setSelected only SELECTS the listview item if in touch mode, but the documentation says that this method will align the listview regardless of whether in touch mode or not.</p>
  
  <p>Does anyone know why this is not working or if there is a better way of going about this?</p>
  
  <p>Thanks, your help is much appreciated!</p>