Firebase shows data in one activity and in another not [closed]

1

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:

    
asked by anonymous 28.09.2016 / 16:44

1 answer

1

I was able to solve it yesterday. What was happening is a bug. After uninstalling the app and running it again it accessed correctly. Thank you.

    
29.09.2016 / 13:29