Code example for HashMap

Methods: put

0
        return myData;
    } 
 
    private static void addItem( 
            List<HashMap<String, Object>> myData, String id, String displayName, long date) {
        final HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(KEY_ID, id);
        map.put(KEY_DISPLAYNAME, displayName);
        final TimeZone tz = TimeZone.getTimeZone(id);
        final int offset = tz.getOffset(date);
        final int p = Math.abs(offset);
        final StringBuilder name = new StringBuilder();
        name.append("GMT");
 
        if (offset < 0) {
            name.append('-');
        } else { 
            name.append('+');
        } 
 
        name.append(p / (HOURS_1));
        name.append(':');
 
        int min = p / 60000;
        min %= 60;
 
        if (min < 10) {
            name.append('0');
        } 
        name.append(min);
 
        map.put(KEY_GMT, name.toString());
        map.put(KEY_OFFSET, offset);
 
        myData.add(map);
    } 
 
    @Override 
    public void onListItemClick(ListView listView, View v, int position, long id) {
        final Map<?, ?> map = (Map<?, ?>)listView.getItemAtPosition(position);