Beginner Button click event
<p>I am new to Android, i am writing a program where when a user clicks a button a <code>Alert Dialog</code> to appear. This alert dialog has 2 buttons, <code>Yes and No</code>. Upon clicking Yes/No, i need to <code>sysout</code> the response.</p>

<p>The code i have so far; Can someone help me add the Alert Dialog;</p>

<pre><code>public class HelloWorldProjectActivity extends Activity implements OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.myFirstScreen);
}

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    if(v.getId()==(R.id.button1)){
        System.out.println("first button clicked");

         // I need a Alert Dialog to appear here, and that will have 2 buttons YES and NO, the users response should be printed to the console.

}
</code></pre>

<p>}</p>
