You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Benny Li (JIRA)" <ji...@apache.org> on 2015/02/20 01:32:11 UTC

[jira] [Created] (CB-8513) Load resource from wrong package

Benny Li created CB-8513:
----------------------------

             Summary: Load resource from wrong package
                 Key: CB-8513
                 URL: https://issues.apache.org/jira/browse/CB-8513
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 3.5.0
            Reporter: Benny Li
            Priority: Minor


In CordovaActivity.java (line 351) and CordovaPreferences.java (line 133), both use the following to get the splash screen:

 getResources().getIdentifier(splash, "drawable", getClass().getPackage().getName());

But in some apps, the class package name does't have to match what you define in the AndroidManifest.xml. It won't load the resource.
So it should be fixed like following, which is how the ConfigXmlParser load the xml config:

this.splashscreen = getResources().getIdentifier(splash, "drawable", getClass().getPackage().getName());;
            
  if (this.splashscreen == 0) {
     // reload by the package name defined in AndroidManifest.xml   

      this.splashscreen = getResources().getIdentifier(splash, "drawable", this.getPackageName());
}



--
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