I'm comparing the strings, if all are equal it has to show a dialog "ALL ARE EQUAL" else another dialog "NOT EQUAL". I want to use only OK button in Alert Dialog. And my code:
if(s1.equals("yes") && s2.equals("yes") && s3.equals("yes") && s4.equals("yes"))
showA();
Where the showA()
method is
private void showA() {
AlertDialog.Builder ab = new AlertDialog.Builder(this);
ab.setTitle("Hello!!");
ab.setMessage("ALL ARE EQUAL");
ab.setCancelable(false);
ab.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
AlertDialog ad = ab.create();
ad.show();
}