I create an AlertDialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
...
AlertDialog alert = builder.create();
alert.show();
<
Set OnClickListener out of main setter like this:
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity())
.setTitle(getResources().getString(R.string.dialog_title))
.setMessage("Waiting ...")
.setNeutralButton(R.string.check, null);
AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();
Button b_neutral = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL);
b_neutral.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
TextView tv_message = (TextView) alertDialog.findViewById(android.R.id.message);
tv_message.setText("Works ...");
}
});