0

I creating an e-commerce Android app using Android Studio. I am using a video on YouTube for guidelines and I hit a wall with this error, and it won't offer any quick fixes.

'FirebaseRecyclerAdapter(com.firebase.ui.database.FirebaseRecyclerOptions<com.example.onlineshop20.Model.Data>)' in 'com.firebase.ui.database.FirebaseRecyclerAdapter' cannot be applied to '(java.lang.Class<com.example.onlineshop20.Model.Data>, int, java.lang.Class<com.example.onlineshop20.AllFragment.CatOneViewHolder>, com.google.firebase.database.DatabaseReference)'

Please, if anyone has faced this or knows how to solve it, please help me. Thanks

@Override
public void onStart() {
    super.onStart();

    FirebaseRecyclerAdapter<Data, CatOneViewHolder>adapterOne=new FirebaseRecyclerAdapter<Data, CatOneViewHolder>
            (
                    Data.class,
                    R.layout.item_data,
                    CatOneViewHolder.class,
                    mCatOneDatabase
            ) {
        @Override
        protected void onBindViewHolder(@NonNull CatOneViewHolder holder, int position, @NonNull Data model) {

        }

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


}
Frank van Puffelen
  • 499,950
  • 69
  • 739
  • 734
  • The constructor you're trying to call doesn't exist, and hasn't exist for over 4 years as far as I can tell. I linked some questions that show how to initialize the `FirebaseRecyclerAdapter` with a `FirebaseRecyclerOptions` nowadays, as also shown in the documentation here: https://github.com/firebase/FirebaseUI-Android/blob/master/database/README.md#using-firebaseui-to-populate-a-recyclerview. Going forward, I recommend searching for the error message you get as these are top results from https://www.google.com/search?q=%27com.firebase.ui.database.FirebaseRecyclerAdapter%27+cannot+be+applied – Frank van Puffelen Mar 30 '22 at 23:47

0 Answers0