I am trying to display data from my firebase database in my listview using Firebase Listadapter. Below is my code
ListView list= findViewById(R.id.list_of_messages);
FirebaseListAdapter<DRive>Adapter=new FirebaseListAdapter<DRive>(this,DRive.class,R.layout.messages,myRef) {
@Override
protected void populateView(View v, DRive model, int position) {
((TextView)v.findViewById(R.id.dropoff)).setText(model.getDropoffspot());
((TextView)v.findViewById(R.id.pickup)).setText(model.getPickupspot());
((TextView)v.findViewById(R.id.timed)).setText(model.getPickuptime());
((TextView)v.findViewById(R.id.points)).setText(model.getPassengers());
}
};
list.setAdapter(Adapter);
}
I am getting the following error when trying to build:
error: constructor FirebaseListAdapter in class FirebaseListAdapter cannot be applied to given types;
required: FirebaseListOptions
found: MainActivity,Class,int,DatabaseReference
reason: actual and formal argument lists differ in length
where T is a type-variable:
T extends Object declared in class FirebaseListAdapter'
I got the idea of the code when Referring to a similar answered question here on stack overflow, How to populate a ListView using a FirebaseListAdapter? ,in this question however the individual used 3 closing brackets at the end when setting his 'prisview' Textview, when I tried that I received an error prompting me to remove the the third bracket. I am kindly asking for assistance