Code example for HashMap

Methods: size

    private static final String ATTR_NAME = "name";
    public PowerProfile(Context context) {
        // Read the XML file for the given profile (normally only one per 
        // device) 
        if (sPowerMap.size() == 0) {
    private void readPowerValuesFromXml(Context context) {
        int id =;
        XmlResourceParser parser = context.getResources().getXml(id);
        boolean parsingArray = false;
        ArrayList<Double> array = new ArrayList<Double>();
        String arrayName = null;
        try { 
            XmlUtils.beginDocument(parser, TAG_DEVICE);
Stop searching for code, let great code find you!  Add Codota to your java IDE