public Bitmap getImageFromResource(String resource) { XKPPackage pack = null; XKPPackage[] wrapperPack = new XKPPackage[] {pack}; int resId = getResourceIdentifierFromPackages(resource, wrapperPack); pack = wrapperPack[0]; if (pack != null) { return pack.getBitmapResource(resId); } return null; }
private int getResourceIdentifierFromPackages(String resource, XKPPackage[] outWrapperPack) { for (int i = 0; i < mPackages.size(); i++) { XKPPackage pack = mPackages.get(i); int resId = pack.getResourceIdentifier(resource); if (resId != -1) { outWrapperPack[0] = pack; return resId; } } outWrapperPack[0] = null; return -1; }