如何仅在来自后台而不是来自其他屏幕或活动时刷新提要?
这是我的项目,以我的为例
private var isAppInBackground = true
override fun onResume() {
super.onResume()
if (isAppInBackground) {
refreshFeed()
}
isAppInBackground = false
}
override fun onPause() {
super.onPause()
isAppInBackground = true
}
private fun refreshFeed() {
//TODO
}