Code example for Stack

Methods: clear

0
    } 
 
    public void reset() { 
        positionRequested.clear();
        runningCount = 0;
        queue.clear();
    } 
 
    /* 
     * If the profile picture has already been downloaded and cached, return it 
     * else execute a new async task to fetch it - if total async tasks >15, 
     * queue the request. 
     */ 
    public Bitmap getImage(String uid, String url) {
        Bitmap image = friendsImages.get(uid);
        if (image != null) {
            return image;
        } 
        if (!positionRequested.containsKey(uid)) {
            positionRequested.put(uid, "");
            if (runningCount >= MAX_ALLOWED_TASKS) {