title: Android PopupWindow showAtLocation() vs showAsDropDown() - first one is working for me and second is not
body: <p>I used the following code to show a PopupWindow in android, I want to pin a popup to a Button,</p>
  
  <pre><code>    btnShowPopup = (Button)findViewById(R.id.btnShowPopup);
      btnShowPopup.setOnClickListener(this);
  
  @Override
  public void onClick(View v) {
      if(v == btnShowPopup){
          View popupViw = getLayoutInflater().inflate(R.layout.popup_demo, null);
          PopupWindow popup = new PopupWindow(this);
          popup.setContentView(popupViw);
          popup.showAsDropDown(btnShowPopup,10,10);
          //popup.showAtLocation(popupViw, Gravity.BOTTOM, 10, 10);
  
      }
  }
  </code></pre>
  
  <p>In this case <code>popup.showAtLocation()</code> is working well, but <code>popup.showAsDropDown()</code> not displaying any popups for me.</p>