You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Nikita Matrosov (JIRA)" <ji...@apache.org> on 2017/04/03 11:13:41 UTC
[jira] [Commented] (CB-12164) setStatusBarColor method lookup fails
on Huawei device [android]
[ https://issues.apache.org/jira/browse/CB-12164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15953295#comment-15953295 ]
Nikita Matrosov commented on CB-12164:
--------------------------------------
Dup of 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: Plugin Statusbar
> Affects Versions: 2.2.0
> Environment: Huawei Honor 7
> Reporter: Rohan McGovern
>
> 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
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org