I'm using firebase. To do a test and how to use it I did the whole procedure in a test activity of my app. I saw that it worked, so I want to put it to the correct activity. The codes of both are correct, but when I run the client activity nothing appears.
Follow the codes:
Activity test:
public class ActivityTeste extends AppCompatActivity {
Firebase objetoRef;
ListView minhaLista;
ArrayList<String> minhaListaDeTarefas = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_teste);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); //Setar o botão voltar
getSupportActionBar().setHomeButtonEnabled(true); //Setar o botão voltar
getSupportActionBar().setDisplayHomeAsUpEnabled(true); //Setar o botão voltar
Firebase.setAndroidContext(this);
minhaLista = (ListView) findViewById(R.id.listViewteste1);
objetoRef = new Firebase("https://XXXXXX.firebaseio.com/");
Firebase novaRef = objetoRef.child("Pessoa");
final FirebaseListAdapter<String> adapter = new FirebaseListAdapter<String>(this, String.class, android.R.layout.simple_list_item_1, novaRef) {
@Override
protected void populateView(View view, String s, int i) {
TextView textView = (TextView) view.findViewById(android.R.id.text1);
textView.setText(s);
}
};
minhaLista.setAdapter(adapter);
}
}
This same code I'm using in the right activity. And this does not show the data: