Code example for SimpleAdapter

0
 
        final String sortKey = (sortedByName ? KEY_DISPLAYNAME : KEY_OFFSET);
        final MyComparator comparator = new MyComparator(sortKey);
        final List<HashMap<String, Object>> sortedList = getZones(context);
        Collections.sort(sortedList, comparator);
        final SimpleAdapter adapter = new SimpleAdapter(context,
                sortedList,
                layoutId,
                from,
                to);
 
        return adapter;
    } 
 
    /** 
     * Searches {@link TimeZone} from the given {@link SimpleAdapter} object, and returns 
     * the index for the TimeZone. 
     * 
     * @param adapter SimpleAdapter constructed by 
     * {@link #constructTimezoneAdapter(Context, boolean)}. 
     * @param tz TimeZone to be searched.