How to integrate this cacheBitmap method, with this image getter code?
<p>How would i go about integrating this cache method..</p>

<pre><code>public void putBitmapInDiskCache(Uri url, Bitmap avatar) {     
    File cacheDir = new File(this.getCacheDir(), "thumbnails");    
    File cacheFile = new File(cacheDir, ""+url.hashCode());     
    try {      
        cacheFile.createNewFile();       
        FileOutputStream fos = new FileOutputStream(cacheFile);    
        avatar.compress(CompressFormat.PNG, 100, fos);      
                    fos.flush();       
        fos.close();     
    } catch (Exception e) {       
        Log.e("error", "Error when saving image to cache. ", e);    
    }
</code></pre>

<p>With this code....</p>

<pre><code>public View getView(int position, View convertView, ViewGroup parent) {
    ImageView i = new ImageView(this.myContext);
    try {
        URL aURL = new URL(myRemoteImages[position]);
        URLConnection conn = aURL.openConnection();
        conn.setUseCaches(true);
        conn.connect();

        InputStream is = conn.getInputStream();
        /* Buffered is always good for a performance plus. */
        BufferedInputStream bis = new BufferedInputStream(is);
        /* Decode url-data to a bitmap. */
        Bitmap bm = BitmapFactory.decodeStream(bis);
        bis.close();
        is.close();
        Log.v(imageUrl, "Retrieving image");

        /* Apply the Bitmap to the ImageView that will be returned. */
        i.setImageBitmap(bm);
    }
</code></pre>

<p>EDIT: Gives me a syntax error </p>

<pre><code>The constructor File(File, int) is undefined



                            Uri imageUri = new Uri(aURL);
                            File cachePath = new File(new File(myContext.getCacheDir(), "thumbnails"), imageUri.hashCode()).exists();
                            if (new File(new File(myContext.getCacheDir(), "thumbnails"), imageUri.hashCode()).exists())
                            {

                            } else {
</code></pre>

<p>EDIT2: Another syntax error</p>

<pre><code>Cannot instantiate the type Uri

  Uri imageUri = new Uri(aURL);
</code></pre>
