我试图在第一个位置的回收者视图中插入一个项目,即0索引如下
try {
commentList.add(new Comment(
Preferences.getProfileImageUrl(),
"",
Preferences.getUserName(DONApplication.getInstance()),
String.valueOf(Preferences.getUserId(DONApplication.getInstance())),
response.getString("comment_id"),
commentText
));
commentAdapter.notifyItemInserted(commentList.size() - 1);
} catch (Exception e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
但它根本没有显示,但当我关闭窗口并再次打开它时,它变得可见.我不知道为什么会这样.有人能帮我吗?
如果用户单击或选择 ag-grid 中的一行,那么我想触发单击事件。我搜索了医生但没有运气。