title: Alert Dialog inside an Onclick Listener Method
body: <pre><code>  rdmrbtn.setOnClickListener(new View.OnClickListener() {
  
              public void onClick(View v) {
  
                  AlertDialog alert = new AlertDialog.Builder(getApplicationContext()).create();
                  alert.setTitle("No Internet access");
                  alert.setMessage("You can't reach the discussion from the Offline mode");
                  alert.setButton("OK", new OnClickListener() {
  
                      public void onClick(DialogInterface dialog, int which) {
                          // TODO Auto-generated method stub
  
                      }
                  })
              }
          });
  </code></pre>
  
  <p>I want show the mentioned alert when the readmore button("rdmrbtn") is clicked. But it gives me some compile errors. Please would you guyz help me out. Thank you.</p>