I have a Fragment and this fragment has a FloatingActionButton .
I call the onClickListener method:
FloatingActionButton floatingActionButton = (FloatingActionButton) view.findViewById(R.id.fabAddEventos);
floatingActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
adicionarEvento(v);
}
});
When I click, I invoke the addEvent method by passing the View as a parameter to create a Dialog with several Edit Text and Button fields. / p>
public void adicionarEvento(View view) {
Dialog dialog = new Dialog(view.getContext());
EditText etEventos_nome = (EditText) view.findViewById(R.id.etEventos_nome);
Button btn_eventos_confirmar = (Button) view.findViewById(R.id.btn_eventos_confirmar);
btn_eventos_confirmar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
}
The error occurs in the Context or View of Dialog, crashing the application.