I'm using this library to display dialogs in my application: link
With this library it is possible to display in the dialog a created layout, but I am not able to capture the user input in the setPositiveButton method.
mMaterialDialog = new MaterialDialog(new ContextThemeWrapper(getActivity(), R.style.MyAlertDialog ) )
.setTitle("Novo Registro")
.setPositiveButton("Novo", new View.OnClickListener() {
@Override
public void onClick(View v) {
// PEGAR DADOS PREENCHIDOS DO FRAGMENT EXIBIDO AQUI
}
})
.setNegativeButton("Voltar", new View.OnClickListener() {
@Override
public void onClick(View v) {
mMaterialDialog.dismiss();
}
});
View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_new_classroom, null);
mMaterialDialog.setView(view).show();
//mMaterialDialog.show();
Can anyone shed light on this or suggest a more appropriate approach?
Thank you!