title: How to define onClick handler method in XML for dialog buttons using FragmentActivity?
body: <p>I'm trying to define an onClick handler method in an XML layout for buttons in a <strong>Dialog</strong> but the app crashes when the buttons are clicked due to NoSuchMethodException (it can't find the method). The method signature is <code>public void searchMovies(View)</code> and I can <strong>guarantee</strong> that it is spelled consistently in the XML file and in code. This <a href="https://stackoverflow.com/questions/4243704/using-onclick-attribute-in-layout-xml-causes-a-nosuchmethodexception-in-android/4321080#4321080">similar question</a> provides a solution by putting the putting the method into the <strong>Activity</strong> that the Dialog belongs to, but that doesn't work for me.  </p>
  
  <p>However, I'm using a <strong>FragmentActivity</strong> and FragmentStatePagerAdapter, so maybe this is the reason it doesn't work for me? I've tried putting the method into the FragmentActivity, the FragmentStatePagerAdapter, the Fragment and also the anonymous OnClickListener class that handles launching the Dialog. None of them have worked, all give NoSuchMethodException error. Again, I can <em>guarantee</em> that the method is spelled correctly/consistently.  </p>
  
  <p>I know that I can do this programmatically, but it would be much more convenient if I could do it the other way. Is it possible? Thanks.</p>