How to test if something is in cache i created?
<p>I created a cache for my images here</p>

<pre><code>            public void putBitmapInDiskCache(URI imageUri, Bitmap avatar) {   
                    File cacheDir = new File(this.getCacheDir(), "thumbnails");
                    cacheDir.mkdirs();
                    File cacheFile = new File(cacheDir, ""+imageUri.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>No i would like to test if something is inside of the cache in my async Task.</p>

<p>Here is my async where i want to test if something is in there. The images i loaded before the application for killed.</p>

<pre><code> //the important AsyncTask method. running the background thread to get the images and set them to the gallery.
                private class MyTask extends AsyncTask&lt;Void, Void, Void&gt;{


                @Override
                protected Void doInBackground(Void... arg0) {try {
                            getImages();
                            Log.v("MyTask", "Image 1 retreived");
                            getImage2();
                            Log.v("MyTask", "Image 2 retreived");
                            getImage3();
                            Log.v("MyTask", "Image 3 retreived");
                            getImage4();
                            Log.v("MyTask", "Image 4 retreived");
                        } catch (IOException e) {
                            Log.e("MainMenu retreive image", "Image Retreival failed");
                            e.printStackTrace();
                        }
                    return null;
                }
</code></pre>
