Fix update check
This commit is contained in:
parent
9f493db180
commit
450ad7520d
|
@ -21,7 +21,9 @@ class CrashHandler(private val context: Context) : UncaughtExceptionHandler {
|
||||||
*/
|
*/
|
||||||
override fun uncaughtException(p0: Thread, p1: Throwable) {
|
override fun uncaughtException(p0: Thread, p1: Throwable) {
|
||||||
Log.e("RLog", "uncaughtException: ${p1.message}")
|
Log.e("RLog", "uncaughtException: ${p1.message}")
|
||||||
|
Looper.myLooper() ?: Looper.prepare()
|
||||||
context.showToastLong(p1.message)
|
context.showToastLong(p1.message)
|
||||||
|
Looper.loop()
|
||||||
p1.printStackTrace()
|
p1.printStackTrace()
|
||||||
android.os.Process.killProcess(android.os.Process.myPid());
|
android.os.Process.killProcess(android.os.Process.myPid());
|
||||||
exitProcess(1)
|
exitProcess(1)
|
||||||
|
|
|
@ -49,11 +49,9 @@ fun Context.installLatestApk() {
|
||||||
private var toast: Toast? = null
|
private var toast: Toast? = null
|
||||||
|
|
||||||
fun Context.showToast(message: String?, duration: Int = Toast.LENGTH_SHORT) {
|
fun Context.showToast(message: String?, duration: Int = Toast.LENGTH_SHORT) {
|
||||||
Looper.myLooper() ?: Looper.prepare()
|
|
||||||
toast?.cancel()
|
toast?.cancel()
|
||||||
toast = Toast.makeText(this, message, duration)
|
toast = Toast.makeText(this, message, duration)
|
||||||
toast?.show()
|
toast?.show()
|
||||||
Looper.loop()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.showToastLong(message: String?) {
|
fun Context.showToastLong(message: String?) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user