Skip to content

Commit 1f719d4

Browse files
committed
fix photo crash
1 parent ca8ce68 commit 1f719d4

File tree

6 files changed

+12
-1783
lines changed

6 files changed

+12
-1783
lines changed

PowerFileExplorer/src/main/java/com/veinhorn/scrollgalleryview/ScrollGalleryView.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,12 @@ public Parcelable onSaveInstanceState() {
262262
bundle.putParcelable("instanceState", super.onSaveInstanceState());
263263
bundle.putBoolean("SLIDESHOW", SLIDESHOW);
264264
bundle.putBoolean("hidden", hidden);
265-
bundle.putSerializable("mListOfMedia", mListOfMedia);
265+
//bundle.putSerializable("mListOfMedia", mListOfMedia);
266+
final ArrayList<String> ml = new ArrayList<>(mListOfMedia.size());
267+
for (File f : mListOfMedia) {
268+
ml.add(f.getAbsolutePath());
269+
}
270+
bundle.putStringArrayList("mListOfMedia", ml);
266271
bundle.putInt("thumbnailSize", thumbnailSize);
267272
bundle.putInt("pageSelected", pageSelected);
268273
removeCallbacks(runSlideshow);
@@ -276,7 +281,12 @@ public void onRestoreInstanceState(Parcelable state) {
276281
final Bundle bundle = (Bundle) state;
277282
SLIDESHOW = bundle.getBoolean("SLIDESHOW", false);
278283
hidden = bundle.getBoolean("hidden", false);
279-
mListOfMedia = (ArrayList<File>) bundle.getSerializable("mListOfMedia");
284+
final ArrayList<String> lm = (ArrayList<String>) bundle.getStringArrayList("mListOfMedia");
285+
if (lm != null && lm.size() > 0) {
286+
for (String st : lm) {
287+
mListOfMedia.add(new File(st));
288+
}
289+
}
280290
sizeMediaFiles = mListOfMedia.size();
281291
thumbnailSize = bundle.getInt("thumbnailSize", 54);
282292
pageSelected = bundle.getInt("pageSelected", pageSelected);

0 commit comments

Comments
 (0)