0

I am getting and displaying images after doing Parse Queries and caching images. My problem is that when i click on the clear cache it doesn't delete the images and my pageviewer with i use to display them. It displays duplicates.I'm using Image Fetcher https://developer.android.com/samples/DisplayingBitmaps/src/com.example.android.displayingbitmaps/util/ImageFetcher.html from Caching Bitmaps from http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html saving files to the phone memory

private ImageFetcher mImageFetcher; ...

public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case android.R.id.home:
        NavUtils.navigateUpFromSameTask(this);
        return true;
    case R.id.logout:
        ParseUser.logOut();
        Intent intent = new Intent(this, LoginActivity.class);
        startActivity(intent);
        finish(); // logout code
        return true;

    case R.id.prefs:
        Intent i = new Intent(this, SharedPrefsActivity.class);
        startActivityForResult(i, RESULT_SETTINGS);

        // intent = new Intent(this, SharedPrefsActivity.class);
        // startActivity(intent);
        // finish(); //logout code
        return true;
    case R.id.clear_cache:
        mImageFetcher.clearCache();
        Toast.makeText(this, R.string.clear_cache_complete_toast,
                Toast.LENGTH_SHORT).show();
        return true;
    }
    return super.onOptionsItemSelected(item);
}
kuhle
  • 193
  • 2
  • 15
  • can you put some code about your image cache? What kind of cache are you using ? Disk, Memory ? If disk, where do you put the images ? Into the cache library, or flushing to SDcard into files ? – narancs Jun 18 '15 at 13:57
  • i'm using ImageFetcher https://developer.android.com/samples/DisplayingBitmaps/src/com.example.android.displayingbitmaps/util/ImageFetcher.html from Caching Bitmaps from http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html saving files to the phone memory – kuhle Jun 18 '15 at 14:02

0 Answers0