As above.
I have got custom Dialog
(which I suppose should be extended by different class...)
public class ResetPasswordDialog extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View v = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_lost_password, null, false);
ButterKnife.bind(this, v);
final AlertDialog dialog = new AlertDialog.Builder(getActivity())
.setTitle(R.string.change_password)
.setCancelable(false)
.setView(v)
.setPositiveButton(R.string.change_password, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//
}
})
.create();
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface arg0) {
Button okButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO: check if password is correct
}
});
}
});
return dialog;
}
}