我正在使用(insert what I tried here, e.g. 'this.attack') is not a function
创建聊天应用,但检索邮件时出现问题,但是用户可以推送该邮件。
我使用了FirebaseDatabase
和ListView
有我的方法FirebaseListAdapter
showMsg()
任何人都知道我在哪里做错了。
更新
ChatMessage.java
final ListView msgs = findViewById(R.id.lv_msg);
Query query = FirebaseDatabase.getInstance().getReference().limitToLast(50);
FirebaseListOptions<ChatMessages> options = new FirebaseListOptions.Builder<ChatMessages>().setQuery(query, ChatMessages.class).setLayout(R.layout.list_item).build();
chatMessageAdapter = new FirebaseListAdapter<ChatMessages>(options) {
@Override
protected void populateView(View v, ChatMessages model, int position) {
TextView msgView, timeView;
CircleImageView profileView;
msgView = v.findViewById(R.id.msg_view);
timeView = v.findViewById(R.id.msg_post_time);
profileView = v.findViewById(R.id.profile_image);
msgView.setText(model.getmText());
timeView.setText(DateFormat.format("DD-MM-YYYY (HH:MM:SS)", model.getmTime()));
Picasso.get().load(model.getmUser()).into(profileView);
}
};
msgs.setAdapter(chatMessageAdapter);