2
I am using this library to display dialogs in my application: https://github.com/drakeet/MaterialDialog
With this library it is possible to display in the dialog a layout created, 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 someone shed some light on this or suggest a more appropriate approach?
Thank you!
Perfect. It worked right here =)
– SpammingOff