Java Code Examples for android.content.pm.PackageManager.getResourcesForApplication()

The following are Jave code examples for showing how to use getResourcesForApplication() of the android.content.pm.PackageManager class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: LaunchEnr   File: Utilities.java   View Source Code Vote up 7 votes
static Pair<String, Resources> findSystemApk(String action, PackageManager pm) {
    final Intent intent = new Intent(action);
    for (ResolveInfo info : pm.queryBroadcastReceivers(intent, 0)) {
        if (info.activityInfo != null &&
                (info.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
            final String packageName = info.activityInfo.packageName;
            try {
                final Resources res = pm.getResourcesForApplication(packageName);
                return Pair.create(packageName, res);
            } catch (NameNotFoundException e) {
                e.printStackTrace();
            }
        }
    }
    return null;
}
 
Example 2
Project: LaunchEnr   File: LauncherIcons.java   View Source Code Vote up 6 votes
/**
 * Returns a bitmap suitable for the all apps view. If the package or the resource do not
 * exist, it returns null.
 */
public static Bitmap createIconBitmap(ShortcutIconResource iconRes, Context context) {
    PackageManager packageManager = context.getPackageManager();
    // the resource
    try {
        Resources resources = packageManager.getResourcesForApplication(iconRes.packageName);
        if (resources != null) {
            final int id = resources.getIdentifier(iconRes.resourceName, null, null);
            return createIconBitmap(resources.getDrawableForDensity(
                    id, LauncherAppState.getIDP(context).fillResIconDpi, context.getTheme()), context);
        }
    } catch (Exception e) {
        // Icon not found.
    }
    return null;
}
 
Example 3
Project: CSipSimple   File: CallHandler.java   View Source Code Vote up 6 votes
@Override
public void onReceive(Context context, Intent intent) {
	if(SipManager.ACTION_GET_PHONE_HANDLERS.equals(intent.getAction())) {
		
		PendingIntent pendingIntent = null;
		String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
		// We must handle that clean way cause when call just to 
		// get the row in account list expect this to reply correctly
		if(number != null && PhoneCapabilityTester.isPhone(context)) {
			// Build pending intent
			Intent i = new Intent(Intent.ACTION_CALL);
			i.setData(Uri.fromParts("tel", number, null));
			pendingIntent = PendingIntent.getActivity(context, 0, i, 0);
		}
		
		// Retrieve and cache infos from the phone app 
		if(!sPhoneAppInfoLoaded) {
   			List<ResolveInfo> callers = PhoneCapabilityTester.resolveActivitiesForPriviledgedCall(context);
   			if(callers != null) {
   				for(final ResolveInfo caller : callers) {
   					if(caller.activityInfo.packageName.startsWith("com.android")) {
   						PackageManager pm = context.getPackageManager();
   						Resources remoteRes;
   						try {
   							// We load the resource in the context of the remote app to have a bitmap to return.
   						    remoteRes = pm.getResourcesForApplication(caller.activityInfo.applicationInfo);
   						    sPhoneAppBmp = BitmapFactory.decodeResource(remoteRes, caller.getIconResource());
   						} catch (NameNotFoundException e) {
   							Log.e(THIS_FILE, "Impossible to load ", e);
   						}
   						break;
   					}
   				}
   			}
   			sPhoneAppInfoLoaded = true;
		}
		
		
		//Build the result for the row (label, icon, pending intent, and excluded phone number)
		Bundle results = getResultExtras(true);
		if(pendingIntent != null) {
			results.putParcelable(CallHandlerPlugin.EXTRA_REMOTE_INTENT_TOKEN, pendingIntent);
		}
		results.putString(Intent.EXTRA_TITLE, context.getResources().getString(R.string.use_pstn));
		if(sPhoneAppBmp != null) {
			results.putParcelable(Intent.EXTRA_SHORTCUT_ICON, sPhoneAppBmp);
		}
		
		// This will exclude next time tel:xxx is raised from csipsimple treatment which is wanted
		results.putString(Intent.EXTRA_PHONE_NUMBER, number);
		
	}
}
 
Example 4
Project: chromium-for-android-56-debug-video   File: WebApkMetaDataUtils.java   View Source Code Vote up 6 votes
/**
 * Populates {@link WebappInfo} with meta data extracted from WebAPK's Android Manifest.
 * @param webApkPackageName Package name of the WebAPK to extract meta data from.
 * @param url WebAPK start URL.
 * @param source {@link ShortcutSource} that the WebAPK was opened from.
 */
public static WebApkInfo extractWebappInfoFromWebApk(
        String webApkPackageName, String url, int source) {
    WebApkMetaData metaData = extractMetaDataFromWebApk(webApkPackageName);
    if (metaData == null) return null;

    PackageManager packageManager = ContextUtils.getApplicationContext().getPackageManager();
    Resources resources;
    try {
        resources = packageManager.getResourcesForApplication(webApkPackageName);
    } catch (PackageManager.NameNotFoundException e) {
        return null;
    }
    Bitmap icon = BitmapFactory.decodeResource(resources, metaData.iconId);
    String encodedIcon = ShortcutHelper.encodeBitmapAsString(icon);

    return WebApkInfo.create(WebApkConstants.WEBAPK_ID_PREFIX + webApkPackageName, url,
            metaData.scope, encodedIcon, metaData.name, metaData.shortName,
            metaData.displayMode, metaData.orientation, source, metaData.themeColor,
            metaData.backgroundColor, TextUtils.isEmpty(metaData.iconUrl), webApkPackageName);
}
 
Example 5
Project: tenor-android-core   File: StringConstant.java   View Source Code Vote up 6 votes
/**
 * Get string from given package with given resource name
 *
 * @param context      given context
 * @param packageName  the package name
 * @param resourceName the resource name
 * @return the string that the resource represents
 */
@NonNull
public static String getString(@NonNull final Context context,
                               @NonNull final String packageName,
                               @NonNull final String resourceName) {

    PackageManager pm = context.getPackageManager();

    try {
        //I want to use the clear_activities string in Package com.android.settings
        Resources res = pm.getResourcesForApplication(packageName);
        int resourceId = res.getIdentifier(packageName + ":string/" + resourceName, null, null);
        if (resourceId != 0) {
            return pm.getText(packageName, resourceId, null).toString();
        }
    } catch (Exception ignored) {
    }
    return EMPTY;
}
 
Example 6
Project: SimpleUILauncher   File: Utilities.java   View Source Code Vote up 6 votes
static Pair<String, Resources> findSystemApk(String action, PackageManager pm) {
    final Intent intent = new Intent(action);
    for (ResolveInfo info : pm.queryBroadcastReceivers(intent, 0)) {
        if (info.activityInfo != null &&
                (info.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
            final String packageName = info.activityInfo.packageName;
            try {
                final Resources res = pm.getResourcesForApplication(packageName);
                return Pair.create(packageName, res);
            } catch (NameNotFoundException e) {
                Log.w(TAG, "Failed to find resources for " + packageName);
            }
        }
    }
    return null;
}
 
Example 7
Project: FlickLauncher   File: Utilities.java   View Source Code Vote up 6 votes
/**
 * Returns a bitmap suitable for the all apps view. If the package or the resource do not
 * exist, it returns null.
 */
public static Bitmap createIconBitmap(String packageName, String resourceName,
        Context context) {
    PackageManager packageManager = context.getPackageManager();
    // the resource
    try {
        Resources resources = packageManager.getResourcesForApplication(packageName);
        if (resources != null) {
            final int id = resources.getIdentifier(resourceName, null, null);
            return createIconBitmap(
                    resources.getDrawableForDensity(id, LauncherAppState.getInstance()
                            .getInvariantDeviceProfile().fillResIconDpi), context);
        }
    } catch (Exception e) {
        // Icon not found.
    }
    return null;
}
 
Example 8
Project: FlickLauncher   File: Utilities.java   View Source Code Vote up 6 votes
static Pair<String, Resources> findSystemApk(String action, PackageManager pm) {
    final Intent intent = new Intent(action);
    for (ResolveInfo info : pm.queryBroadcastReceivers(intent, 0)) {
        if (info.activityInfo != null &&
                (info.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
            final String packageName = info.activityInfo.packageName;
            try {
                final Resources res = pm.getResourcesForApplication(packageName);
                return Pair.create(packageName, res);
            } catch (NameNotFoundException e) {
                Log.w(TAG, "Failed to find resources for " + packageName);
            }
        }
    }
    return null;
}
 
Example 9
Project: SetupWizardLibCompat   File: Partner.java   View Source Code Vote up 6 votes
/**
 * Find and return partner details, or {@code null} if none exists. A partner package is marked
 * by a broadcast receiver declared in the manifest that handles the
 * {@code com.android.setupwizard.action.PARTNER_CUSTOMIZATION} intent action. The overlay
 * package must also be a system package.
 */
public static synchronized Partner get(Context context) {
    if (!sSearched) {
        PackageManager pm = context.getPackageManager();
        final Intent intent = new Intent(ACTION_PARTNER_CUSTOMIZATION);
        for (ResolveInfo info : pm.queryBroadcastReceivers(intent, 0)) {
            if (info.activityInfo == null) {
                continue;
            }
            final ApplicationInfo appInfo = info.activityInfo.applicationInfo;
            if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
                try {
                    final Resources res = pm.getResourcesForApplication(appInfo);
                    sPartner = new Partner(appInfo.packageName, res);
                    break;
                } catch (NameNotFoundException e) {
                    Log.w(TAG, "Failed to find resources for " + appInfo.packageName);
                }
            }
        }
        sSearched = true;
    }
    return sPartner;
}
 
Example 10
Project: SimpleUILauncher   File: Utilities.java   View Source Code Vote up 6 votes
/**
 * Returns a bitmap suitable for the all apps view. If the package or the resource do not
 * exist, it returns null.
 */
public static Bitmap createIconBitmap(String packageName, String resourceName,
        Context context) {
    PackageManager packageManager = context.getPackageManager();
    // the resource
    try {
        Resources resources = packageManager.getResourcesForApplication(packageName);
        if (resources != null) {
            final int id = resources.getIdentifier(resourceName, null, null);
            return createIconBitmap(
                    resources.getDrawableForDensity(id, LauncherAppState.getInstance()
                            .getInvariantDeviceProfile().fillResIconDpi), context);
        }
    } catch (Exception e) {
        // Icon not found.
    }
    return null;
}
 
Example 11
Project: GitHub   File: Utils.java   View Source Code Vote up 5 votes
static Resources getResources(Context context, Request data) throws FileNotFoundException {
  if (data.resourceId != 0 || data.uri == null) {
    return context.getResources();
  }

  String pkg = data.uri.getAuthority();
  if (pkg == null) throw new FileNotFoundException("No package provided: " + data.uri);
  try {
    PackageManager pm = context.getPackageManager();
    return pm.getResourcesForApplication(pkg);
  } catch (PackageManager.NameNotFoundException e) {
    throw new FileNotFoundException("Unable to obtain resources for package: " + data.uri);
  }
}
 
Example 12
Project: keepass2android   File: PluginManager.java   View Source Code Vote up 5 votes
Resources getResources(Context context) {
    PackageManager packageManager = context.getPackageManager();
    Resources res = null;
    try {
        ApplicationInfo appInfo = packageManager.getApplicationInfo(mPackageName, 0);
        res = packageManager.getResourcesForApplication(appInfo);
    } catch (NameNotFoundException e) {
        Log.i(TAG, "couldn't get resources");
    }
    return res;
}
 
Example 13
Project: atlas   File: AtlasBridgeApplication.java   View Source Code Vote up 5 votes
@Override
public Resources getResources() {
    Resources rs =  super.getResources();
    if (rs == null){
        PackageManager pm = getPackageManager();
        try {
            rs = pm.getResourcesForApplication(getApplicationInfo());
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            return null;
        }
    }
    return rs;
}
 
Example 14
Project: PaletteGetter   File: PaletteGetter.java   View Source Code Vote up 4 votes
@Nullable
@ColorInt
public static Integer get(Context context, ComponentName componentName) {
    PackageManager packageManager = context.getPackageManager();

    ActivityInfo activityInfo = null;
    PackageInfo packageInfo = null;
    Resources resources = null, activityResources = null;
    try {
        packageInfo = packageManager.getPackageInfo(componentName.getPackageName(), PackageManager.GET_META_DATA);
        resources = packageManager.getResourcesForApplication(packageInfo.applicationInfo);
        activityInfo = packageManager.getActivityInfo(componentName, 0);
        activityResources = packageManager.getResourcesForActivity(componentName);
    } catch (PackageManager.NameNotFoundException ignored) {
    }

    if (packageInfo != null && resources != null) {
        if (activityInfo != null && activityResources != null) {
            List<Integer> activityStatusBarColors = getResourceColors(activityInfo.packageName, resources, activityInfo.theme);
            if (activityStatusBarColors.size() > 0) {
                return activityStatusBarColors.get(0);
            }
        }

        List<Integer> statusBarColors = getResourceColors(packageInfo.packageName, resources, packageInfo.applicationInfo.theme);
        if (statusBarColors.size() > 0) {
            return statusBarColors.get(0);
        }

        if (packageInfo.activities != null) {
            for (ActivityInfo otherActivityInfo : packageInfo.activities) {
                List<Integer> otherStatusBarColors = getResourceColors(packageInfo.packageName, resources, otherActivityInfo.theme);
                if (otherStatusBarColors.size() > 0) {
                    return otherStatusBarColors.get(0);
                }
            }
        }
    }

    return null;
}
 
Example 15
Project: keepass2android   File: PluginManager.java   View Source Code Vote up 4 votes
static void getHKDictionaries(PackageManager packageManager) {
    Intent dictIntent = new Intent(HK_INTENT_DICT);
    List<ResolveInfo> dictPacks = packageManager.queryIntentActivities(dictIntent, 0);
    for (ResolveInfo ri : dictPacks) {
        ApplicationInfo appInfo = ri.activityInfo.applicationInfo;
        String pkgName = appInfo.packageName;
        boolean success = false;
        try {
            Resources res = packageManager.getResourcesForApplication(appInfo);
            Log.i("KP2AK", "Found dictionary plugin package: " + pkgName);
            int langId = res.getIdentifier("dict_language", "string", pkgName);
            if (langId == 0) continue;
            String lang = res.getString(langId);
            int[] rawIds = null;
            
            // Try single-file version first
            int rawId = res.getIdentifier("main", "raw", pkgName);
            if (rawId != 0) {
                rawIds = new int[] { rawId };
            } else {
                // try multi-part version
                int parts = 0;
                List<Integer> ids = new ArrayList<Integer>();
                while (true) {
                    int id = res.getIdentifier("main" + parts, "raw", pkgName);
                    if (id == 0) break;
                    ids.add(id);
                    ++parts;
                }
                if (parts == 0) continue; // no parts found
                rawIds = new int[parts];
                for (int i = 0; i < parts; ++i) rawIds[i] = ids.get(i);
            }
            DictPluginSpec spec = new DictPluginSpecHK(pkgName, rawIds);
            mPluginDicts.put(lang, spec);
            Log.i("KP2AK", "Found plugin dictionary: lang=" + lang + ", pkg=" + pkgName);
            success = true;
        } catch (NameNotFoundException e) {
            Log.i("KP2AK", "bad");
        } finally {
            if (!success) {
                Log.i("KP2AK", "failed to load plugin dictionary spec from " + pkgName);
            }
        }
    }
}
 
Example 16
Project: GxIconDIY   File: PkgUtil.java   View Source Code Vote up 4 votes
@TargetApi(17)
public static String getAppLabelEn(Context context, String pkgName, String def) {
    if (context == null || TextUtils.isEmpty(pkgName)) {
        return def;
    }

    String result = def;
    try {
        PackageManager packageManager = context.getPackageManager();
        ApplicationInfo applicationInfo = packageManager.getPackageInfo(pkgName, 0).applicationInfo;

        Configuration configuration = new Configuration();
        // It's better, I think, to use Locale.ENGLISH
        // instead of Locale.ROOT (although I want to do).
        if (C.SDK >= 17) {
            configuration.setLocale(Locale.ENGLISH);
        } else {
            configuration.locale = Locale.ENGLISH;
        }
        // The result is a value in disorder maybe if using:
        //     packageManager.getResourcesForApplication(PACKAGE_NAME)
        Resources resources = packageManager.getResourcesForApplication(applicationInfo);
        resources.updateConfiguration(configuration,
                context.getResources().getDisplayMetrics());
        int labelResId = applicationInfo.labelRes;
        if (labelResId != 0) {
            // If the localized label is not added, the default is returned.
            // NOTICE!!!If the default were empty, Resources$NotFoundException would be called.
            result = resources.getString(labelResId);
        }

        /*
         * NOTICE!!!
         * We have to restore the locale.
         * On the one hand,
         * it will influence the label of Activity, etc..
         * On the other hand,
         * the got "resources" equals the one "this.getResources()" if the current .apk file
         * happens to be this APK Checker(com.by_syk.apkchecker).
         * We need to restore the locale, or the language of APK Checker will change to English.
         */
        if (C.SDK >= 17) {
            configuration.setLocale(Locale.getDefault());
        } else {
            configuration.locale = Locale.getDefault();
        }
        resources.updateConfiguration(configuration, context.getResources().getDisplayMetrics());
    } catch (Exception e) {
        e.printStackTrace();
    }

    return result;
}
 
Example 17
Project: GxIconAndroid   File: PkgUtil.java   View Source Code Vote up 4 votes
@TargetApi(17)
public static String getAppLabelEn(Context context, String pkgName, String def) {
    if (context == null || TextUtils.isEmpty(pkgName)) {
        return def;
    }

    String result = def;
    try {
        PackageManager packageManager = context.getPackageManager();
        ApplicationInfo applicationInfo = packageManager.getPackageInfo(pkgName, 0).applicationInfo;

        Configuration configuration = new Configuration();
        // It's better, I think, to use Locale.ENGLISH
        // instead of Locale.ROOT (although I want to do).
        if (C.SDK >= 17) {
            configuration.setLocale(Locale.ENGLISH);
        } else {
            configuration.locale = Locale.ENGLISH;
        }
        // The result is a value in disorder maybe if using:
        //     packageManager.getResourcesForApplication(PACKAGE_NAME)
        Resources resources = packageManager.getResourcesForApplication(applicationInfo);
        resources.updateConfiguration(configuration,
                context.getResources().getDisplayMetrics());
        int labelResId = applicationInfo.labelRes;
        if (labelResId != 0) {
            // If the localized label is not added, the default is returned.
            // NOTICE!!!If the default were empty, Resources$NotFoundException would be called.
            result = resources.getString(labelResId);
        }

        /*
         * NOTICE!!!
         * We have to restore the locale.
         * On the one hand,
         * it will influence the label of Activity, etc..
         * On the other hand,
         * the got "resources" equals the one "this.getResources()" if the current .apk file
         * happens to be this APK Checker(com.by_syk.apkchecker).
         * We need to restore the locale, or the language of APK Checker will change to English.
         */
        if (C.SDK >= 17) {
            configuration.setLocale(Locale.getDefault());
        } else {
            configuration.locale = Locale.getDefault();
        }
        resources.updateConfiguration(configuration, context.getResources().getDisplayMetrics());
    } catch (Exception e) {
        e.printStackTrace();
    }

    return result;
}
 
Example 18
Project: icon_pack_loader   File: PkgUtils.java   View Source Code Vote up 4 votes
@TargetApi(17)
public static String getAppLabelEn(Context context, String pkgName, String def) {
    if (context == null || TextUtils.isEmpty(pkgName)) {
        return def;
    }

    String result = def;
    try {
        PackageManager packageManager = context.getPackageManager();
        ApplicationInfo applicationInfo = packageManager.getPackageInfo(pkgName, 0).applicationInfo;

        Configuration configuration = new Configuration();
        // It's better, I think, to use Locale.ENGLISH
        // instead of Locale.ROOT (although I want to do).
        if (C.SDK >= 17) {
            configuration.setLocale(Locale.ENGLISH);
        } else {
            configuration.locale = Locale.ENGLISH;
        }
        // The result is a value in disorder maybe if using:
        //     packageManager.getResourcesForApplication(PACKAGE_NAME)
        Resources resources = packageManager.getResourcesForApplication(applicationInfo);
        resources.updateConfiguration(configuration,
                context.getResources().getDisplayMetrics());
        int labelResId = applicationInfo.labelRes;
        if (labelResId != 0) {
            // If the localized label is not added, the default is returned.
            // NOTICE!!!If the default were empty, Resources$NotFoundException would be called.
            result = resources.getString(labelResId);
        }

        /*
         * NOTICE!!!
         * We have to restore the locale.
         * On the one hand,
         * it will influence the label of Activity, etc..
         * On the other hand,
         * the got "resources" equals the one "this.getResources()" if the current .apk file
         * happens to be this APK Checker(com.by_syk.apkchecker).
         * We need to restore the locale, or the language of APK Checker will change to English.
         */
        if (C.SDK >= 17) {
            configuration.setLocale(Locale.getDefault());
        } else {
            configuration.locale = Locale.getDefault();
        }
        resources.updateConfiguration(configuration, context.getResources().getDisplayMetrics());
    } catch (Exception e) {
        e.printStackTrace();
    }

    return result;
}
 
Example 19
Project: NanoIconPack   File: PkgUtil.java   View Source Code Vote up 4 votes
@TargetApi(17)
public static String getAppLabelEn(Context context, String pkgName, String def) {
    if (context == null || TextUtils.isEmpty(pkgName)) {
        return def;
    }

    String result = def;
    try {
        PackageManager packageManager = context.getPackageManager();
        ApplicationInfo applicationInfo = packageManager.getPackageInfo(pkgName, 0).applicationInfo;

        Configuration configuration = new Configuration();
        // It's better, I think, to use Locale.ENGLISH
        // instead of Locale.ROOT (although I want to do).
        if (C.SDK >= 17) {
            configuration.setLocale(Locale.ENGLISH);
        } else {
            configuration.locale = Locale.ENGLISH;
        }
        // The result is a value in disorder maybe if using:
        //     packageManager.getResourcesForApplication(PACKAGE_NAME)
        Resources resources = packageManager.getResourcesForApplication(applicationInfo);
        resources.updateConfiguration(configuration,
                context.getResources().getDisplayMetrics());
        int labelResId = applicationInfo.labelRes;
        if (labelResId != 0) {
            // If the localized label is not added, the default is returned.
            // NOTICE!!!If the default were empty, Resources$NotFoundException would be called.
            result = resources.getString(labelResId);
        }

        /*
         * NOTICE!!!
         * We have to restore the locale.
         * On the one hand,
         * it will influence the label of Activity, etc..
         * On the other hand,
         * the got "resources" equals the one "this.getResources()" if the current .apk file
         * happens to be this APK Checker(com.by_syk.apkchecker).
         * We need to restore the locale, or the language of APK Checker will change to English.
         */
        if (C.SDK >= 17) {
            configuration.setLocale(Locale.getDefault());
        } else {
            configuration.locale = Locale.getDefault();
        }
        resources.updateConfiguration(configuration, context.getResources().getDisplayMetrics());
    } catch (Exception e) {
        e.printStackTrace();
    }

    return result;
}
 
Example 20
Project: emerald   File: IconPackManager.java   View Source Code Vote up 4 votes
public void setIcons() {
	iconsData = new HashMap<String, String>();
	iconBacks = null;
	iconMask = null;
	iconUpon = null;
	factor = 1.0f;
	iconPackRes = null;
	if (iconPackName.equals("default")) {
		return;
	}
	transformDrawable = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(Keys.TRANSFORM_DRAWABLE, true);
	String component = null;
	String drawable = null;
	PackageManager pm = context.getPackageManager();
	iconBacks = new ArrayList<Bitmap>();
	try {
		iconPackRes = pm.getResourcesForApplication(iconPackName);
	} catch (PackageManager.NameNotFoundException nameNotFound) {
	
	}
	try {
		int id = iconPackRes.getIdentifier("appfilter", "xml", iconPackName);
		XmlPullParser parser = iconPackRes.getXml(id);
		int parserEvent = parser.getEventType();
		
		while (parserEvent != XmlPullParser.END_DOCUMENT) {
			if (parserEvent == XmlPullParser.START_TAG){
				if (parser.getName().equals("item")) {
					for (int i = 0; i < parser.getAttributeCount(); i++) {
						if (parser.getAttributeName(i).equals("component")) {
							component = parser.getAttributeValue(i);
							int c = component.indexOf("{");
							component = component.substring(c+1, component.length()-1);
						} else if (parser.getAttributeName(i).equals("drawable")) {
							drawable = parser.getAttributeValue(i);
						}
					}
					iconsData.put(component, drawable);
				} else if (parser.getName().equals("iconback")) {
					for (int i = 0; i < parser.getAttributeCount(); i++) {
						iconBacks.add(loadBitmap(parser.getAttributeValue(i)));
					}
				} else if (parser.getName().equals("iconmask")) {
					if (parser.getAttributeCount() > 0 && parser.getAttributeName(0).equals("iconmask")) {
						iconMask = loadBitmap(parser.getAttributeValue(0));
					}
				} else if (parser.getName().equals("iconupon")) {
					if (parser.getAttributeCount() > 0 && parser.getAttributeName(0).equals("iconupon")) {
						iconUpon = loadBitmap(parser.getAttributeValue(0));
					}
				} else if (parser.getName().equals("scale")) {
					if (parser.getAttributeCount() > 0 && parser.getAttributeName(0).equals("factor")) {
						factor = Float.valueOf(parser.getAttributeValue(0));
					}
				}
			}
			parserEvent = parser.next();
		}
		
	} catch (Exception e) {
		//iconsData.put("error", e.toString());
	}
}