title: What am I implementing wrong?
body: <p>I am trying to get my button to display a dialog box. When clicking, it does nothing.</p>
  <p>Here is my code:</p>
  <pre><code>public class MainActivity extends AppCompatActivity implements View.OnClickListener {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
      @Override
      public void onClick(View view) {
          Button btn = (Button) findViewById(R.id.btnHelloWorld);
          btn.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  AlertDialog.Builder dialog = new AlertDialog.Builder(this);
                  dialog.setTitle(&quot;Made by&quot;);
                  dialog.setMessage(&quot;Justin Rhinehart\nMGMS | APM\n5/4/2021&quot;);
                  dialog.setPositiveButton(&quot; OK &quot;, new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int id ) {
                          dialog.dismiss();
                      }
                  });
                  dialog.show();
              }
          });
      }
  }
  
  </code></pre>
  <p>Any help would be appreciated as I am new to Java.</p>