cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rohan McGovern (JIRA)" <>
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
             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

window.getClass().getDeclaredMethod("setStatusBarColor", int.class).invoke(window, Color.parseColor(colorPref));

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
while the method belongs to superclass

Replacing getDeclaredMethod with getMethod fixes the problem.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message