Skip to content Skip to sidebar Skip to footer

How To Add Progressbar For Loading In Firebase Recyclerview

I am developing an Android app The App fetches the data from Firebase using FirebaseRecyclerAdapter and I need to implement a ProgressBar in that Recyler View. How to add Rrogres

Solution 1:

Because you are using FirebaseRecyclerAdapter, you can override the onDataChanged() method in your adapter class. So create a new object of ProgressBar and start showing it in the onCreate() method, or if you want, you can add it directly in your .XML file. Finally in your adapter class, use the following lines of code:

@Override
public void onDataChanged() {
    if (progressBar != null) {
        progressBar.setVisibility(View.GONE);
    }
}

Post a Comment for "How To Add Progressbar For Loading In Firebase Recyclerview"