Fix update check

This commit is contained in:
Ash 2022-10-15 20:31:08 +08:00
parent 9f493db180
commit 450ad7520d
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,9 @@ class CrashHandler(private val context: Context) : UncaughtExceptionHandler {
*/
override fun uncaughtException(p0: Thread, p1: Throwable) {
Log.e("RLog", "uncaughtException: ${p1.message}")
Looper.myLooper() ?: Looper.prepare()
context.showToastLong(p1.message)
Looper.loop()
p1.printStackTrace()
android.os.Process.killProcess(android.os.Process.myPid());
exitProcess(1)

View File

@ -49,11 +49,9 @@ fun Context.installLatestApk() {
private var toast: Toast? = null
fun Context.showToast(message: String?, duration: Int = Toast.LENGTH_SHORT) {
Looper.myLooper() ?: Looper.prepare()
toast?.cancel()
toast = Toast.makeText(this, message, duration)
toast?.show()
Looper.loop()
}
fun Context.showToastLong(message: String?) {