gyf-dev / ImmersionBar

android 4.4以上沉浸式状态栏和沉浸式导航栏管理,适配横竖屏切换、刘海屏、软键盘弹出等问题,可以修改状态栏字体颜色和导航栏图标颜色,以及不可修改字体颜色手机的适配,适用于Activity、Fragment、DialogFragment、Dialog,PopupWindow,一句代码轻松实现,以及对bar的其他设置,详见README。简书请参考:http://www.jianshu.com/p/2a884e211a62
Apache License 2.0
11.31k stars 1.89k forks source link

你好,遇到一个兼容性BUG,在Android 6.0.1某些机型上,具体见内容 #529

Open zhanglong520 opened 2 years ago

zhanglong520 commented 2 years ago

24002 java.lang.ClassCastException

java.lang.String cannot be cast to java.lang.Object[] com.gyf.barlibrary.BarConfig.boolean hasNavBar(android.app.Activity)(BarConfig.java:100)

4 java.lang.ClassCastException:java.lang.String cannot be cast to java.lang.Object[] 5 android.util.ArrayMap.allocArrays(ArrayMap.java:187) 6 android.util.ArrayMap.put(ArrayMap.java:459) 7 android.app.ActivityThread.installProvider(ActivityThread.java:5221) 8 android.app.ActivityThread.acquireProvider(ActivityThread.java:4789) 9 android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:1999) 10 android.content.ContentResolver.acquireProvider(ContentResolver.java:1452) 11 android.provider.Settings$NameValueCache.lazyGetProvider(Settings.java:1309) 12 android.provider.Settings$NameValueCache.getStringForUser(Settings.java:1356) 13 android.provider.Settings$Global.getStringForUser(Settings.java:7785) 14 android.provider.Settings$Global.getString(Settings.java:7774) 15 android.provider.Settings$Global.getInt(Settings.java:7841) 16 com.gyf.barlibrary.BarConfig.boolean hasNavBar(android.app.Activity)(BarConfig.java:100) 17 com.gyf.barlibrary.BarConfig.int getNavigationBarHeight(android.content.Context)(BarConfig.java:72) 18 com.gyf.barlibrary.BarConfig.void (android.app.Activity)(BarConfig.java:51) 19 com.gyf.barlibrary.ImmersionBar.void updateBarParams()(ImmersionBar.java:1670) 20 com.gyf.barlibrary.ImmersionBar.void init()(ImmersionBar.java:1631)

查看源码发现是BarConfig这个类里面---从这一行开始的 if (Settings.Global.getInt(activity.getContentResolver(), MIUI_FORCE_FSG_NAV_BAR, 0) != 0) { return false; }

设备机型 Springer602

系统版本 Android 6.0.1,level 23

ROM Android_BULLET/reno

CPU架构 armeabi-v7a