記錄工作中的點點滴滴之異常

在近期的工作中,報出了這一異常導(dǎo)致程序直接崩潰,經(jīng)多方查閱

2021-06-18 14:17:46.325 15201-15201/com.icbc.im E/ActivityInjector: get life cycle exception

? ? java.lang.ClassCastException: android.os.BinderProxy cannot be cast to android.app.servertransaction.ClientTransaction

? ? ? ? at android.app.ActivityInjector.checkAccessControl(ActivityInjector.java:24)

? ? ? ? at android.app.Activity.onResume(Activity.java:1854)

? ? ? ? at android.support.v4.app.FragmentActivity.onResume(FragmentActivity.java:485)

? ? ? ? at com.icbc.im.ui.activity.BaseActivity.onResume(BaseActivity.java:189)

? ? ? ? at com.icbc.chat.activity.WebViewActivity.onResume(WebViewActivity.java:3343)

? ? ? ? at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1454)

? ? ? ? at android.app.Activity.performResume(Activity.java:8051)

是因為小米的MIUI11/12主題切換 具體解釋如下:

Since MIUI 11/12 Use Its Own Custom Implementation of Dark Mode, using below code results in ClassCastException and Activity Life Cycle Exception, as DefaultNightMode and LocalNightMode is always Unspecified i.e. -100 instead of 0 or 1.

給到的建議是:

Just goto values.xml and place this in your AppTheme

進(jìn)入values.xml中并把<item name="android:forceDarkAllowed" >false</item> 添加到AppTheme中。

再次記錄一下以便后續(xù)工作。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容