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() {
|
||||
super.onResume();
|
||||
tryloadGallery();
|
||||
if (mState != null && mGridView != null)
|
||||
if (mState != null && mGridView != null) {
|
||||
mGridView.onRestoreInstanceState(mState);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
deleteFiles();
|
||||
if (mGridView != null)
|
||||
if (mGridView != null && isChangingConfigurations()) {
|
||||
mState = mGridView.onSaveInstanceState();
|
||||
} else {
|
||||
mState = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void tryloadGallery() {
|
||||
|
|
Loading…
Reference in New Issue