如何在android中执行图像clear_cache

时间:2015-06-18 13:54:49

标签: android image parse-platform clear-cache

在进行Parse Queries和缓存图像后,我正在显示图像。我的问题是,当我点击清除缓存时,它不会删除图像,而我的页面浏览器用于显示它们。它显示重复。我正在使用从https://developer.android.com/samples/DisplayingBitmaps/src/com.example.android.displayingbitmaps/util/ImageFetcher.html保存文件到手机记忆库的缓存位图中的图像提取器http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html

私人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);
}

0 个答案:

没有答案