gyf-dev / gyf-dev/ImmersionBar

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

Open
#529 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
11.5k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

#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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with BarConfig.java at lines 100 and 72, then follow the Settings.Global call in the provided stack trace. Reproduce initialization on Android 6.0.1 API level 23 using the Springer602 device or equivalent environment, and verify that navigation-bar detection completes without the reported ClassCastException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.