1

I do work around an application that displays data from a database on a firebase but there is a problem that if the user does not have a connection in the internet the blank page appears containing nothing Use this code to view data.

    ref.child("Sat").addValueEventListener(new ValueEventListener() {

        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {

            satelliteList.clear();


            for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
                Satellite satellite = snapshot.getValue(Satellite.class);
                satelliteList.add(satellite);
                adapter.notifyDataSetChanged();
            }
            Collections.reverse(satelliteList);
        }

        @Override
        public void onCancelled(DatabaseError databaseError) {


        }
    });
  • Java has nothing to do with JavaScript, even though both have "Java" in their name. Please don't use that tag on questions that have nothing to do with the language. See also https://stackoverflow.com/a/245068/6296561. Additionally, please don't use the AS tag for questions that aren't about the IDE itself. – Zoe Apr 13 '19 at 18:35

0 Answers0