[
https://issues.apache.org/jira/browse/CB-12164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
jcesarmobile closed CB-12164.
-----------------------------
Resolution: Duplicate
closing as duplicate of https://issues.apache.org/jira/browse/CB-12188
> setStatusBarColor method lookup fails on Huawei device [android]
> ----------------------------------------------------------------
>
> Key: CB-12164
> URL: https://issues.apache.org/jira/browse/CB-12164
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-plugin-statusbar
> Affects Versions: 2.2.0
> Environment: Huawei Honor 7
> Reporter: Rohan McGovern
> Priority: Major
>
> On a Huawei Honor 7, attempting to set status bar color will fail with log
> message "StatusBar: Method window.setStatusBarColor not found for SDK level
> 23".
> The problem seems to be here in StatusBar.java:
> {noformat}
> window.getClass().getDeclaredMethod("setStatusBarColor",
> int.class).invoke(window, Color.parseColor(colorPref));
> {noformat}
> Because getDeclaredMethod is used here, it will only look up methods declared
> on the window's class, and not any superclasses.
> Therefore it doesn't work on this device, where the window is of type
> com.android.internal.policy.HwPhoneWindow while the method belongs to
> superclass com.android.internal.policy.PhoneWindow.
> Replacing getDeclaredMethod with getMethod fixes the problem.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]