I am having an error when I perform queries in firebase, my code for query looks like this:
@Override
protected void onCreate(Bundle savedInstanceState) {
To solve your problem, just declare nome, cpf and placa Strings inside the coresponding onDataChange() methods, otherwise is null, due the asynchronous behaviour.
As an example, please use this code:
public void onDataChange(DataSnapshot dataSnapshot) {
String nome = dataSnapshot.getValue(String.class);
TextView txtNome = (TextView) findViewById(R.id.txtNomePerfil);
txtNome.setText(nome);
}
In the same way, you need to make the other changes.