【发布时间】:2021-10-04 12:03:08
【问题描述】:
有些查询直接在RecipeDao.kt中返回结果,ide的侧面板写道:在com.example.mypackage.data.RecipeDao_Impl中实现 但其他人不返回结果 像给定日期的这个问题我提取应用程序数据库并在其他sqlite浏览器应用程序中查询它并成功执行
CoroutineScope(Dispatchers.IO).launch {
dateNoDay?.get(pos)?.let { dateQuery -> //dateQuery here is yyyy/M
allRecipesByMonth = async {
recipeDao.getAllRecipesByMonth(
"'$dateQuery/01'",
"'$dateQuery/31'"
)
}
}
withContext(Dispatchers.Main) {
allRecipesByMonth.await()
archiveRecipesAdapter = context?.let {
ArchiveRecipesAdapter(
allFactorsByMonthOfYear.await(),
it
)
}
archiveRecipesAdapter?.notifyDataSetChanged()
}
}
}
【问题讨论】:
标签: android android-room kotlin-coroutines dagger-hilt