title: Calling a method from layout xml with DialogFragment.. how does that work?
body: <p>Let's say I have this button:</p>
  
  <pre><code>&lt;Button
  android:id="@+id/idone"
  android:layout_width="0dip"
  android:layout_height="wrap_content"
  android:layout_weight="1"
  android:text="D2"
  android:onClick="myMeth"/&gt;
  </code></pre>
  
  <p>I have several times used this to call methods from a layout xml as it calls the method from the activity that inflated such view.</p>
  
  <p>Recently with DialogFragments, well it does not work at all.  I keep getting an error telling me that such method does not exist.  Where is it then looking for such method? I have added it to the DialogFragment class:</p>
  
  <pre><code>public class myActivity extends DialogFragment {
  
  public DiceDialog() {
      // empty constructor
  }
  
   @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.myDialog, container);
          getDialog().setTitle("Hello");
          return view;
      }
  
  public void myMeth(View view) {
  //...
      }
  </code></pre>
  
  <p>As well as in the activity that instantiates the FragmentManager and calls the dialog:</p>
  
  <pre><code>public Class MainActiviry Extends  FragmentActivity {
  
  //...
  public void onCreate(Bundle savedInstanceState) {
  // ..
  FragmentManager fm = getSupportFragmentManager();
  MyActivity dialog = new AddDiceDialog();
  dialog.show(fm, "tag");
  }
  
  public void myMeth(View view){
  //...
  }
  </code></pre>
  
  <p>And still the messag is that MyMeth is not found.</p>
  
  <p>I have already <a href="https://stackoverflow.com/questions/10867425/communication-between-fragments-dialogs-in-android">read</a> that using interfaces and listeners is the correct way to communicate between activity and dialog fragments, but what I am trying to figure out here is where that myMeth call is being made, because well,it is called.</p>