diff --git a/module_core/src/main/java/com/gh/gamecenter/core/utils/ToastUtils.kt b/module_core/src/main/java/com/gh/gamecenter/core/utils/ToastUtils.kt index 950a243502..d7d2da3cd3 100644 --- a/module_core/src/main/java/com/gh/gamecenter/core/utils/ToastUtils.kt +++ b/module_core/src/main/java/com/gh/gamecenter/core/utils/ToastUtils.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.core.utils import com.gh.gamecenter.core.HaloApp +import com.gh.gamecenter.core.runOnUiThread import com.lightgame.utils.toast.ToastHelper object ToastUtils { @@ -12,12 +13,16 @@ object ToastUtils { @JvmStatic fun showToast(message: String) { - ToastHelper.showToast(HaloApp.getInstance(), message) + runOnUiThread { + ToastHelper.showToast(HaloApp.getInstance(), message) + } } @JvmStatic fun showToast(message: String, gravity: Int = -1, yOffset: Int = 0) { - ToastHelper.showToast(HaloApp.getInstance(), message, gravity, yOffset) + runOnUiThread { + ToastHelper.showToast(HaloApp.getInstance(), message, gravity, yOffset) + } } }