title: Android Button Inside PopupWindow
body: <p>I have a popupwindow in my application that is meant to act as a sort of settings window.  Inside of this there will be a couple little views like checkboxes and what not, but I seem to be having a problem getting one to work properly.</p>
  
  <p>Currently I only have one button in the view that it's inflating, and I'm trying to use it to close the popup window, but I am getting a NullPointerException when I try to setup the onClickListener.  In fact, if I refer to the button at all, even in something like "button.isShown()", it gives me the exception as if the button didn't exist.</p>
  
  <p>I've tried everything I could think of, but nothing quite solves this problem.  I assume there would be a way to have working buttons inside a PopupWindow, or do I need to modify some form of dialog to get the effect I am after?  </p>
  
  <p>Thank you for your help.</p>