【发布时间】:2022-01-03 21:57:14
【问题描述】:
var list:ArrayList<ProfilePost> = ArrayList()
GlobalScope.launch {
list= apiInterface.GetVideosByUser(ApiInterface.PublicationRequestBodyGet(id.toString()))
.await().publications
}
runOnMainThread {
adapter = ProfilePostAdapter(list, "mine")
recylcerPost.adapter = adapter
recylcerPost.layoutManager = GridLayoutManager(context, 3)
}
在这段代码中,我无法获取列表变量中出版物的值,因此列表保持为空。 而且我需要将回收站视图的创建与 GetVideosByUser 函数分开,因为它会冻结我的屏幕
【问题讨论】: