I searched all internet web sites to fix this error, but I couldn\'t. I just want to create AlertDialog with two button Yes and No.
This is my code:
impo
I face such a case and I was managed to solve it. Here it is:
public class MainActivity extends AppCompatActivity {
AlertDialog.Builder alertDialog;
alertDialog = new AlertDialog.Builder(this);
public void onFinish() {
alertDialog.setIcon(android.R.drawable.alert_light_frame);
alertDialog.setTitle("You are done");
alertDialog.setMessage("you got it");
alertDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
runTheCode();
}
});
alertDialog.show();