Code example for SparseArray

Methods: clear

0
 
    /** 
     * Reset the caches associated with the coordinate layouts. 
     */ 
    static void resetCaches() { 
        mCache.clear();
    } 
 
    /** 
     * Returns coordinates for elements inside a conversation header view given 
     * the view width. 
     */ 
    public static MessageListItemCoordinates forWidth(Context context, int width) {
        MessageListItemCoordinates coordinates = mCache.get(width);
        if (coordinates == null) {
            coordinates = new MessageListItemCoordinates();
            mCache.put(width, coordinates);
            // TODO: make the field computation done inside of the constructor and mark fields final 
 
            // Layout the appropriate view. 
            int mode = getMode(context, width);