I cant see any FirebaseRecyclerAdapter items on my layout

Solution 1:

The tutorial that you are following is wrong. To solve your problem, please consider following these steps.

  1. Move all the code from the onStart() method inside onCreate() method except these two lines of code:

    super.onStart();
    firebaseAuth.addAuthStateListener(authStateListener);
    
  2. Make your firebaseRecyclerAdapter varaible global:

    private FirebaseRecyclerAdapter<Blog, BlogViewHolder> firebaseRecyclerAdapter;
    
  3. Remove FirebaseRecyclerAdapter<Blog, BlogViewHolder> from the onCreate() method.

  4. Add the following lines of code in the onStart() and onStop() methods.

    @Override
    protected void onStart() {
        super.onStart();
        firebaseRecyclerAdapter.startListening();
    }
    
    @Override
    protected void onStop() {
        super.onStop();
        if(firebaseRecyclerAdapter != null) {
            firebaseRecyclerAdapter.stopListening();
        }
    }
    
  5. The most important thing is to remove the static keyword from your class declaration. Should be only:

    public class PostViewHolder extends RecyclerView.ViewHolder {}