Suddenly (without any changes in this project code) I started to obtained an error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{<package>}: java.lang.IllegalArgumentException: Button does not exist
that error points to a method which wasn't yet called.
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();
}
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?