Don't close cursor prematurely

This commit is contained in:
nielsandriesse 2021-04-14 10:49:19 +10:00
parent d1f00b6d77
commit 2d42d22df4

View File

@ -311,11 +311,6 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
private int cleanupMedia() { private int cleanupMedia() {
int restartItem = mediaPager.getCurrentItem(); int restartItem = mediaPager.getCurrentItem();
PagerAdapter adapter = mediaPager.getAdapter();
if (adapter instanceof CursorPagerAdapter) {
((CursorPagerAdapter)adapter).cursor.close();
}
mediaPager.removeAllViews(); mediaPager.removeAllViews();
mediaPager.setAdapter(null); mediaPager.setAdapter(null);