title: Android ListPopupWindow's method isShowing() does not work
body: <p>I've decided to create my own custom spinner by extending a <code>TextView</code> and composing a <code>ListPopupWindow</code>. I want to emulate the following functionality of the original <code>Spinner</code>: when the spinner is clicked the drop down list is shown, the second time the spinner is clicked the drop down list is dismissed. But I'm having some trouble, the <code>ListPopupWindow.isShowing()</code> seems to always return <code>false</code> (I've debugged it):</p>
  
  <pre><code>public class CustomSpinner extends TextView {
      ...
      private ListPopupWindow dropDownPopup;
      ...
      public CustomSpinner(Context context, AttributeSet attrs) {
          super(context, attrs);
          ...
          dropDownPopup = new ListPopupWindow(context, attrs);
          dropDownPopup.setAnchorView(this);
          dropDownPopup.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
          dropDownPopup.setOnItemClickListener(new OnItemClickListener() {
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                  dropDownPopup.dismiss();
                  ...
              }
          });     
  
          this.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {                
                  if (dropDownPopup.isShowing()) {
                      dropDownPopup.dismiss();
                  } else {
                      dropDownPopup.show();
                  }
              }
          });
      }
  </code></pre>
  
  <p>So, each time I click on the spinner the drop down list is shown. It is dismissed when I click on one of the items in the list. The problem seems to be that <code>dropDownPopup.isShowing()</code> always returns <code>false</code>.</p>