title: Problems with ListView inside a PopupWindow
body: <p>I have a <code>ListView</code> in a <code>PopupWindow</code>. The <code>PopupWindow</code> is initialized like this</p>
  
  <pre><code>    window.setContentView(root);
      window.setTouchable(true);
      window.setFocusable(true);
      window.setOutsideTouchable(true);
      window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
      window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
  </code></pre>
  
  <p>Then the <code>ListView</code>:</p>
  
  <pre><code>    fileList = (ListView) root.findViewById(R.id.explorer_list);
      fileList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
      fileList.setSelector(android.R.drawable.screen_background_light_transparent);
      fileList.setOnItemClickListener(this);
  
      [...]
  
      @Override
      public void onItemClick(AdapterView&lt;?&gt; adapter, View v, int pos, long id) {
          selected = (File) fileList.getItemAtPosition(pos);      
      }
  </code></pre>
  
  <p>Like this, everything works correctly except that the selector will not show up on selection until <code>ListView</code> is scrolled (nothing shows visually as selected until the list is scrolled, although the item is correctly selected).</p>
  
  <p>If I set the <code>PopupWindow</code> not focusable, then the visual selection works correctly (the item is visually selected right when clicked into) but <code>onItemClick()</code> is never called and thus I cannot get the selected item.</p>
  
  <p><code>ListView.getSelectedItem()</code> always returns <code>null</code> in both cases, even if there's a selected item.</p>
  
  <p>Any idea on how to solve this situation? Thanks in advance.</p>