public void run() { mAllImages.removeImageAt(mCurrentPosition); if (mAllImages.getCount() == 0) { finish(); return; } else { if (mCurrentPosition == mAllImages.getCount()) { mCurrentPosition -= 1; } } mImageView.clear(); mCache.clear(); // Because the position number is changed. setImage(mCurrentPosition, true); }
@Override public void onStop() { super.onStop(); mPaused = true; // mGetter could be null if we call finish() and leave early in // onStart(). if (mGetter != null) { mGetter.cancelCurrent(); mGetter.stop(); mGetter = null; } setMode(MODE_NORMAL); // removing all callback in the message queue mHandler.removeAllGetterCallbacks(); if (mAllImages != null) { mSavedUri = getCurrentUri(); mAllImages.close(); mAllImages = null; } hideOnScreenControls(); mImageView.clear(); mCache.clear(); for (ImageViewTouchBase iv : mSlideShowImageViews) { iv.clear(); } }