We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
假如有一个删除接口,你首先在viewmodel里面定义了一个 delResult的一个MutableLiveData对象,然后在viewmodel里面写了删除的方法。正常来说,我们是在Activity里面,调用这个删除方法吧?然后就是 xxxViewmodel.delResult.observe(viewLifecycleOwner) { //删除item } 没毛病吧? 但是,因为删除接口返回的内容,都是一样的。所以,第一次删除的时候,上面的监听是能走到的。但第二次调用删除,返回接口返回的内容一样,所以delResult就是不变的,上面的监听并不会走到。这个问题,你是怎么处理的?
The text was updated successfully, but these errors were encountered:
没有明白您是要删除同一条数据么,还是说删除多条数据?
Sorry, something went wrong.
你可以参照todo和meshare中的删除部分示例代码
No branches or pull requests
假如有一个删除接口,你首先在viewmodel里面定义了一个 delResult的一个MutableLiveData对象,然后在viewmodel里面写了删除的方法。正常来说,我们是在Activity里面,调用这个删除方法吧?然后就是 xxxViewmodel.delResult.observe(viewLifecycleOwner) {
//删除item
}
没毛病吧?
但是,因为删除接口返回的内容,都是一样的。所以,第一次删除的时候,上面的监听是能走到的。但第二次调用删除,返回接口返回的内容一样,所以delResult就是不变的,上面的监听并不会走到。这个问题,你是怎么处理的?
The text was updated successfully, but these errors were encountered: