Делал чат по видеоуроку, но вылезла ошибка - error: constructor FirebaseListAdapter in class FirebaseListAdapter cannot be applied to given types;
adapter= new FirebaseListAdapter(this, Message.class, R.layout.list_item, FirebaseDatabase.getInstance().getReference()) {
required: FirebaseListOptions
found: MainActivity,Class,int,DatabaseReference
reason: actual and formal argument lists differ in length
where T is a type-variable:
private void displayAllMessages() {
ListView listOfMessages = findViewById(R.id.list_of_messages);
adapter= new FirebaseListAdapter<Message>(this, Message.class, R.layout.list_item, FirebaseDatabase.getInstance().getReference()) {
@Override
protected void populateView(View v, Message model, int position) {
TextView mess_user, mess_time, mess_text;
mess_user = v.findViewById(R.id.message_user);
mess_time = v.findViewById(R.id.message_time);
mess_text = v.findViewById(R.id.message_text);
mess_user.setText(model.getUserName());
mess_text.setText(model.getTextMessage());
mess_time.setText(DateFormat.format("dd-MM-yyyy HH:mm:ss", model.getMessageTime()));
}
};
listOfMessages.setAdapter(adapter);
}
Помогите разобраться, пожалуйста.