firebaserecycleradapter() cannot be applied to FirebaseRecyclerAdapter

firebaserecycleradapter implementation
firebaserecycleradapter dependency
firebaserecycleradapter not working
firebaserecycleradapter parameters
firebaserecycleroptions
firebase recycler options not found
firebase recycler options dependency
firebaserecycleradapter kotlin

Can someone please tell what's the error in that specific line.

Here is the error message showing.

package com.example.souravkumar.sqaurewallpapers;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.squareup.picasso.Picasso;

/**
 * Created by Sourav Kumar on 11/3/2017.
 */

public class popular extends AppCompatActivity {

    private RecyclerView recyclerView;
    private DatabaseReference myRef;
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
        recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
        recyclerView.setHasFixedSize(true);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        myRef = FirebaseDatabase.getInstance().getReference();
        FirebaseRecyclerAdapter<image_details, BlogViewHolder> adapter = new FirebaseRecyclerAdapter<image_details, BlogViewHolder>(
                image_details.class,
                R.layout.individual_row,

                myRef) {
            @Override
            protected void onBindViewHolder(BlogViewHolder holder, int position, image_details model) {
                holder.setDate(model.getDate());
                holder.setUrl(model.getUrl());
            }

            @Override
            public BlogViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
                return null;
            }
        };

        recyclerView.setAdapter(adapter);

    }

    public static  class BlogViewHolder extends RecyclerView.ViewHolder {
        TextView textView;
        ImageView imageView;
        public BlogViewHolder(View itemView) {
            super(itemView);
            textView = (TextView)itemView.findViewById(R.id.date);
            imageView = (ImageView)itemView.findViewById(R.id.imageView);
        }

        public void setDate(Long date) {
            textView.setText(date.toString());
        }

        public void setUrl(String url) {
            Picasso.with(itemView.getContext())
                    .load(url)
                    .resize(50, 50)
                    .centerCrop()
                    .into(imageView);
        }
    }
}

Link to the whole code


The latest version (3.x) of FirebaseUI implements a different method of initializing a FirebaseRecyclerAdapter than previous versions. From the using the FirebaseRecyclerAdapter documentation:

First, configure the adapter by building FirebaseRecyclerOptions. In this case we will continue with our chat example:

 FirebaseRecyclerOptions<Chat> options =
                new FirebaseRecyclerOptions.Builder<Chat>()
                        .setQuery(query, Chat.class)
                        .build();

Next create the FirebaseRecyclerAdapter object. You should already have a ViewHolder subclass for displaying each item.

So, for your example, you'll need to do something similar to:

FirebaseRecyclerOptions<image_details> options =
        new FirebaseRecyclerOptions.Builder<image_details>()
                .setQuery(myRef, image_details.class)
                .build();

FirebaseRecyclerAdapter adapter = new FirebaseRecyclerAdapter<image_details, BlogViewHolder>(options) {
    @Override
    public BlogViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.individual_row, parent, false);

        return new BlogViewHolder(view);
    }

    @Override
    protected void onBindViewHolder(BlogViewHolder holder, int position, image_details model) {
        // Bind the image_details object to the BlogViewHolder
        // ...
    }
};

Finally, the FirebaseRecyclerAdapter uses an event listener to monitor changes to the Firebase query. To begin listening for data, call adapter.startListening() and adapter.stopListening() to stop the listener. It's recommended to call these in onStart() and onStop() respectively. Further details on this are available in the FirebaseRecyclerAdapter lifecycle documentation.

Cannot apply FirebaseRecyclerAdapter?, FirebaseRecyclerAdapter; import com.firebase.ui.database. "​FirebaseRecyclerAdapter() in FirebaseRecyclerAdapter cannot be applied to:  FirebaseRecyclerAdapter class takes in the last version as an argument in the constructor a FirebaseRecyclerOptions object not those 4 arguments anymore. If you are interested, this is a recommended way in which you can retrieve data from a Firebase Realtime database and display it in a RecyclerView using FirebaseRecyclerAdapter.


You missed a method to start the activity. Add this in onStart() method:

firebaseRecyclerAdapter.startListening();

RecyclerView using FirebaseRecyclerAdapter is not displaying , I am using FirebaseRecyclerAdapter to load and display items in RecyclerView. addItemDecoration(new DividerItemDecoration(getContext(), in class FirebaseRecyclerAdapter<T,VH> cannot be applied to given types  error: constructor FirebaseRecyclerAdapter in class FirebaseRecyclerAdapter cannot be applied to given types; required: FirebaseRecyclerOptions found: Class,int,Class,DatabaseReference reason: actual and formal argument lists differ in length where T,VH are type-variables: T extends Object declared in class FirebaseRecyclerAdapter VH extends


Hello your error is due to a missing argument in these () that are found beside this

<image_details, BlogViewHolder>

so you missed one more argument of your BlogViewHolder class so I will add the piece of code and refer your missing argument by a comment in this :

FirebaseRecyclerAdapter<image_details, BlogViewHolder> adapter = new FirebaseRecyclerAdapter<image_details, BlogViewHolder>(
            image_details.class,
            R.layout.individual_row,
            BlogViewHolder.class //see this is missing so you should add it       
            myRef) {

i can't find populateviewholder method in firebaserecycleradapter , setLayoutManager(new LinearLayoutManager(this)); } @Override protected void onStart() { super.onStart(); FirebaseRecyclerAdapter<Users  I am getting cannot resolve FirebaseRecyclerAdapter when trying to use it even after adding firebase ui in gradle dependency.Thanks in advance


This is the right way :

FirebaseRecyclerOptions<image_details> options =
    new FirebaseRecyclerOptions.Builder<image_details>()
            .setQuery(myRef, image_details.class)
            .build();

FirebaseRecyclerAdapter adapter = new FirebaseRecyclerAdapter<image_details, BlogViewHolder>(options) {
    @Override
    public BlogViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.individual_row, parent, false);

        return new BlogViewHolder(view);
    }

    @Override
    protected void onBindViewHolder(BlogViewHolder holder, int position, image_details model) {
        // Bind the image_details object to the BlogViewHolder
        // ...
    }
};

Issue with FirebaseRecyclerAdapter. Firebase UI 1.2.0 compared to , it being stated that: FirebaseRecyclerAdapter() in FirebaseRecyclerAdapter cannot be applied to: Expected Parameters: Actual Arguments:. I am using FirebaseRecyclerAdapter to load and display items in RecyclerView. When I execute my code it is not displaying any item. It is working perfectly fine when I debug my code. I have tried n


I had the same error and this worked very well for me. Hope it helps someone

//loads data into recycler view onstart up
@Override
protected void onStart() {
    super.onStart();

    FirebaseRecyclerOptions<Data> options =
            new FirebaseRecyclerOptions.Builder<Data>()
                    .setQuery(dbReference, Data.class)
                    .build();

    FirebaseRecyclerAdapter firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<Data, DataViewHolder>(options) {
        @Override
        public DataViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.row, parent, false);

            return new DataViewHolder(view);
        }

        @Override
        protected void onBindViewHolder(@NonNull DataViewHolder holder, int position, @NonNull Data model) {
            // Bind the image_details object to the BlogViewHolder
            // ...
            holder.setDetails(getApplicationContext(), model.getName(), model.getDepartment(), model.getDescription());
        }
    };



    firebaseRecyclerAdapter.startListening();
    recyclerView.setAdapter(firebaseRecyclerAdapter);

}

error: constructor FirebaseRecyclerAdapter in class - android, error: constructor FirebaseRecyclerAdapter in class FirebaseRecyclerAdapter cannot be applied to given types - android. ClickListener() { #Override public void onItemClick(View view, int position) { Toast.makeText(getActivity(), "Item click at  The FirebaseRecyclerAdapter sets the childValueEventListener on the location we specified in our reference. To test that the view automatically updates when an item is deleted, let’s open the Database tab in our Firebase app and delete a restaurant by selecting the red "X" near its node:


Problem in FirebaseRecyclerAdapter, Error: (73, 86) error: constructor FirebaseRecyclerAdapter in class FirebaseRecyclerAdapter cannot be applied to given types; The following are the types of  I am trying to use the FirebaseRecyclerAdapter with the compile 'com.firebaseui:firebase-ui-database:0.4.0' dependency. However, it does not recognise it.


FirebaseUI for Realtime Database, ChildEventListener childEventListener = new ChildEventListener() The FirebaseRecyclerAdapter binds a Query to a RecyclerView . When data is added, removed, or changed these updates are automatically applied to your UI in real time. Using the FirebaseRecyclerAdapter. The FirebaseRecyclerAdapter binds a Query to a RecyclerView. When data is added, removed, or changed these updates are automatically applied to your UI in real time. First, configure the adapter by building FirebaseRecyclerOptions. In this case we will continue with our chat example:


android: firebaserecycleradapter() cannot be applied to , firebaserecycleradapter() cannot be applied to FirebaseRecyclerAdapter. android firebase FirebaseRecyclerAdapter; import com.google.firebase.​database. Eu tentando ler os dados do firebase e colocar no recycler view, porém está dando esse erro. Error:(77, 73) error: constructor FirebaseRecyclerAdapter in class FirebaseRecyclerAdapter cannot be