修改 AndroidManifest.xml 中 <application android:theme="..."> 或 <activity android:theme="..."> 後,Toast.makeText(...).show() 不再彈出,但無任何報錯。
Theme.NoTitleBar、Theme.Translucent.NoTitleBar),導致 Toast 所依賴的窗口類型(TYPE_TOAST)無法正常顯示。android:windowIsTranslucent="true" 或 android:windowBackground="@null"**,干擾 Toast 窗口繪製。SYSTEM_ALERT_WINDOW 權限且非前台,Toast 可能被系統屏蔽(但通常仍會顯示)。@android:style/Theme.AppCompat.Light 或 Theme.MaterialComponents.Light,確認 Toast 是否恢復。若恢復,說明 Theme 確實是原因。Theme.AppCompat.*、Theme.MaterialComponents.*),不要直接繼承 Theme 或 Theme.NoTitleBar。windowIsTranslucent、windowBackground="@null"、windowNoTitle 等屬性嘗試。Toast.makeText(context, msg, Toast.LENGTH_SHORT).show() 中 context 非 null(建議用 getApplicationContext() 或 Activity.this)。styles.xml 設置 <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item>,而非繼承 NoTitleBar 主題。ToastUtils.show(),統一上下文獲取、日誌記錄,便於後續排查。