Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }