Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8513

Load resource from wrong package

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 3.5.0
    • None
    • cordova-android
    • None

    Description

      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());
      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vanbli Van Dev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: