cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rohan McGovern (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-12164) setStatusBarColor method lookup fails on Huawei device [android]
Date Sat, 19 Nov 2016 02:36:58 GMT
Rohan McGovern created CB-12164:
-----------------------------------

             Summary: 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.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message