Extend Dialog goes wrong in android
<p>I extend a Dialog</p>

<p>java code</p>

<pre><code>public class Dialog_query extends Dialog implements OnClickListener {   

}  
</code></pre>

<p>Through the XML defines a interface
<img src="http://i.stack.imgur.com/HFuZm.jpg" alt="enter image description here"></p>

<p>Now want to select date by clicking on 日期1
The code is as follow
Recorded as:code button</p>

<p>java button</p>

<pre><code>Button btn=(Button)findViewById(R.id.BtnDate);           
        btn.setOnClickListener(new View.OnClickListener() {   
          public void onClick(View v) {   
            new DatePickerDialog(Dialog_query.this,   
                d2,   
                dateAndTime.get(Calendar.YEAR),   
                dateAndTime.get(Calendar.MONTH),   
                dateAndTime.get(Calendar.DAY_OF_MONTH)   
                ).show();   
          }   
        }); 
</code></pre>

<p>Now the question is,point out"The constructor DatePickerDialog(Dialog_query, DatePickerDialog.OnDateSetListener, int, int, int) is undefined"</p>

<p>Later found in here to add"Toast.makeText(LoginSuccess.this, "About agile software 1.0", Toast.LENGTH_LONG).show();"</p>

<p>also point out"The method makeText(Context, CharSequence, int) in the type Toast is not  applicable for the arguments (Dialog_query, String, int)"</p>

<p>But the "code button" is right in Activity.</p>

<p>Why in the extend cases will prompt such a mistake?</p>
