0

解析クエリを実行して画像をキャッシュした後、画像を取得して表示しています。私の問題は、キャッシュのクリアをクリックしても、画像とページビューアーが削除されないことです。重複が表示されます。 http://developer.androidのキャッシュ ビットマップからImage Fetcher https://developer.android.com/samples/DisplayingBitmaps/src/com.example.android.displayingbitmaps/util/ImageFetcher.htmlを使用しています。 .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);
}
4

0 に答える 0