英文:
How to add new item in recyclerview without refreshing other item
问题
I'm developing chat application. Every thing works fine but when data is added or removed from then from the chat then how to update that item without disturbing other just like Facebook and Whatsapp.
这是我的数据库。
我知道mAdapter.notifyItemInserted(position);
,但如何在嵌套的RecyclerView中使用呢?
英文:
I'm developing chat application. Every thing works fine but when data is added or removed from then from the chat then how to update that item without disturbing other just like Facebook and Whatsapp.
This is my database.
i know about mAdapter.notifyItemInserted(position);
but how we do for nested recyclerview ?
答案1
得分: 1
要更新特定行,您可以使用以下代码:
mAdapter.notifyItemChanged(position)
英文:
To update a particular row, you can use following
mAdapter.notifyItemChanged(position)
答案2
得分: 0
使用FirebaseUI进行实时数据库
FirebaseRecyclerAdapter将查询绑定到RecyclerView。当数据被添加、移除或更改时,这些更新会实时自动应用到您的用户界面中。
查看此链接Firebase实时数据库的Firebase UI
您不会后悔的。
英文:
use FirebaseUI for Realtime Database
The FirebaseRecyclerAdapter binds a Query to a RecyclerView. When data is added, removed, or changed these updates are automatically applied to your UI in real time.
see this link Firebase UI for realtime database
you won't regret with
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论