title: My dialog box below does not work, Please correct
body: <pre><code>pbutton.setOnClickListener(new OnClickListener()
      {   private AlertDialog show;
          public void onClick(View arg0)
          {   
              if ((input1.getText().length() == 0) || (input1.getText().toString().equals(" ")) || (input2.getText().length() == 0) || (input2.getText().toString().equals(" "))|| (input1.getText().toString().equals(""))||(input2.getText().toString().equals("")))
              {
  
              show = new AlertDialog.Builder(MainActivity.this).setTitle("Error").setMessage("Some inputs are empty").setPositiveButton("OK", null).show();
              }
              double result = new Double(input1.getText().toString())+ new Double(input2.getText().toString());
              output.setText(Double.toString(result));
  
          }
  </code></pre>
  
  <p>I've also tried passing the context which also doesn't work</p>