I use this code in my android project:
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
But, Eclipse says that setButton()
is deprecated. Please, help me with an alternative solution. Thanks!
I hope the above code is a good one in which dialog works very well
Use:
setButton(int whichButton, CharSequence text, DialogInterface.OnClickListener listener);
For
whichButton
use one of the following: