我正在通过其他应用程序的隐式 Intent 启动我的应用程序,在我完成一些工作后我想退出应用程序并返回到原来的位置。
我的代码:
if (intent.type == MY_INTENT_TYPE) {
CoroutineScope(Dispatchers.IO).launch {
delay(5000)
progressBar.visibility = View.GONE
withContext(Dispatchers.Main) {
finish()
}
}
}
问题是我在调用 finish()
2020-09-03 10:25:39.547 20181-20181/com.example.shareway E/libc: Access denied finding property "ro.vendor.df.effect.conflict"
2020-09-03 10:25:39.588 20181-20253/com.example.shareway E/Perf: Fail to get file list com.example.shareway 2020-09-03 10:25:39.590
20181-20253/com.example.shareway E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
我怎样才能退出应用程序并返回到上一个屏幕而不出现错误?
最佳答案
好吧..我的错。
代码完全没问题,就是忘了动
progressBar.visibility = View.GONE
到主线程
关于android - 如何完成应用程序并返回上一屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63718893/