mttkay / ignition

Kick-starts Android application development.
1.28k stars 290 forks source link

How can i show a picture from cache? #40

Open fossilo opened 12 years ago

fossilo commented 12 years ago

Hello i try to show the picture from the iginition support sample in an ImageView, but cant get this working.. i am not sure why..?

image = (ImageView)findViewById(R.id.imageView1);
HttpResponseCache cache = http.getResponseCache();
        if (cache != null) {
            List<File> cachedFiles = cache.getCachedFiles();
            for (File file : cachedFiles) {
                Bitmap myB = BitmapFactory.decodeFile(file.getAbsolutePath());
                image.setImageBitmap(myBitmap);
            }
        }

The problem is, that my BitmapFactory gives back: null What is wrong in my code??