title: AlertDialog Button does not exist
body: <p>Suddenly (without any changes in this project code) I started to obtained an error:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{&lt;package&gt;}: java.lang.IllegalArgumentException: Button does not exist
  </code></pre>
  
  <p>that error points to a method which wasn't yet called.</p>
  
  <pre><code>private void dialog(String title, String content){
      AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
      alertDialog.setTitle(title);
      alertDialog.setMessage(content);
      alertDialog.setCancelable(true);
      alertDialog.setButton(1, "OK", new DialogInterface.OnClickListener() {
             public void onClick(DialogInterface dialog, int which) {
                 dialog.dismiss();
                 }
              });
      alertDialog.show();
  }
  </code></pre>
  
  <p>I tried to copy and use that code in other project - same result, and it was working not long ago (same target API etc.). Any idea what I'm overlooking?</p>