I'm having trouble passing data from an activity to a fragment, I'd like to use a radio button to set a parameter for a variable, dps pass that value to the fragment to be able to do the treatment, example ... At the time of login the user would choose the adm option and this parameter would be sent to the fragment that inside an if to determine the chosen option. How to pass this data ???
The structure would look something like this ...
Checking the type in the activity
if (morador.isChecked()){
tipo = "morador";
}
if (sindico.isChecked()){
tipo = "sindico";
}
No fragment
Here I would have to receive this type variable there from the activity with the values and proceed to treat the data ...
//Caminho
if(tipo == sindico) {
databaseReference1 = FirebaseConfig.getFirebase().child("Usuarios").child(usuarioLogado).child("nome");
databaseReference2 = FirebaseConfig.getFirebase().child("Usuarios").child(usuarioLogado).child("apartamento");
databaseReference3 = FirebaseConfig.getFirebase().child("Usuarios").child(usuarioLogado).child("bloco");
}else if(tipo == morador) {
databaseReference1 = FirebaseConfig.getFirebase().child("Sindico").child(usuarioLogado).child("nome");
databaseReference2 = FirebaseConfig.getFirebase().child("Sindico").child(usuarioLogado).child("apartamento");
databaseReference3 = FirebaseConfig.getFirebase().child("Sindico").child(usuarioLogado).child("bloco");
}