mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-04-03 21:21:06 +02:00
properly handle orientation changes
This commit is contained in:
parent
cdc07b0bff
commit
31100a3afe
@ -79,16 +79,20 @@ public class MediaActivity extends SimpleActivity
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
tryloadGallery();
|
tryloadGallery();
|
||||||
if (mState != null && mGridView != null)
|
if (mState != null && mGridView != null) {
|
||||||
mGridView.onRestoreInstanceState(mState);
|
mGridView.onRestoreInstanceState(mState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
deleteFiles();
|
deleteFiles();
|
||||||
if (mGridView != null)
|
if (mGridView != null && isChangingConfigurations()) {
|
||||||
mState = mGridView.onSaveInstanceState();
|
mState = mGridView.onSaveInstanceState();
|
||||||
|
} else {
|
||||||
|
mState = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tryloadGallery() {
|
private void tryloadGallery() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user