how to refresh cloud firebase database ..sometimes it shows old values : when i open the page sometimes it shows old values of cloud firebase so for that i need when activity opens firstly it should refresh and then proceed.
I tried to refresh it but its not working..
 mfirestore.collection("Design1").addSnapshotListener(new EventListener<QuerySnapshot>() {
            @Override
            public void onEvent(QuerySnapshot documentSnapshots, FirebaseFirestoreException e) {
                for (DocumentChange doc : documentSnapshots.getDocumentChanges()) {
                    if (doc.getType() == DocumentChange.Type.ADDED) {
                        Users users = doc.getDocument().toObject(Users.class);
                        usersList.add(users);
                        usersrecycleradapter.notifyDataSetChanged();
                    }
                }
            }
        });

        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        FloatingActionButton fab = findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(Pic1.this,Cart1.class);
                startActivity(intent);

            }
        });
        mfirestore.collection("Extraimage").document("Design1").get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
            @Override
            public void onSuccess(DocumentSnapshot documentSnapshot) {
                String image1=documentSnapshot.getString("image1");
                Glide.with(Pic1.this).load(image1).into(imageView);

            }
        });


        context();
    }
    public void context(){
        refresh(1000);
    }
    private void refresh(int milisecond){
        final Handler handler=new Handler();
        final Runnable runnable=new Runnable() {
            @Override
            public void run() {
                context();
            }

        };
        handler.postDelayed(runnable,milisecond);
    }
}
