Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的 android 应用程序中使用数据 mvvm 架构,并使用数据绑定填充 xml 项。AsyncTask在我用于从数据库获取数据的视图模型类中,这给我带来了一些麻烦。首先调用 UI 线程,并且我的 xml 项保持为空。我必须做什么?
AsyncTask
我找到了我的解决方案。我只是notifyPropertyChanged(BR.item);在填充我的项目之后和@BindablegetMethod 之前放置
notifyPropertyChanged(BR.item);
@Bindable