简体   繁体   English

如何在 dismiss() DialogFragment 后刷新 Fragment 上的 RecycleView?

[英]How to reflesh RecycleView on Fragment after dismiss() DialogFragment?

Could you tell me the way to refresh data on RecycleView on Fragment.你能告诉我在Fragment上刷新RecycleView数据的方法吗? On DialogFragment, there are some TextInputEditText, and users could change the data.在 DialogFragment 上,有一些 TextInputEditText,用户可以更改数据。 After users closed DialogFragment with dismiss(), RecycleView isn't changed.用户使用 dismiss() 关闭 DialogFragment 后,RecycleView 没有改变。

Tried to use Intetnt back to RecycleView, but I think it is not correct way.尝试使用 Intetnt 返回 RecycleView,但我认为这不是正确的方法。 My environment is JAVA, Android Studio.我的环境是JAVA,Android工作室。

You can use StartActivityForResult, it is the best way to get you modified data, here's a link to documentation and how to integrated it enter link description here您可以使用 StartActivityForResult,这是获取修改数据的最佳方式,这里是文档的链接以及如何集成它,在此处输入链接描述

You must notify all reorganized observer that the data set is altered to get visual effects using notifyDataSetChanged().您必须使用 notifyDataSetChanged() 通知所有重组观察者数据集已更改以获得视觉效果。 More details on notifyDataSetChanged() 有关 notifyDataSetChanged() 的更多详细信息

This link also shows the use of notifyDataSetChanged() 此链接还显示了 notifyDataSetChanged() 的使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM