Skip to content

Commit d7792d5

Browse files
VaishSiddharthnicolas-raoul
authored andcommitted
In media search results, rotating screen triggers crash fixed commons-app#1753
1 parent 781cfac commit d7792d5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
<activity
115115
android:name=".explore.SearchActivity"
116116
android:label="@string/title_activity_search"
117+
android:configChanges="orientation|keyboardHidden"
117118
android:parentActivityName=".contributions.ContributionsActivity"
118119
/>
119120

app/src/main/java/fr/free/nrw/commons/explore/SearchActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.free.nrw.commons.explore;
22

3+
import android.content.res.Configuration;
34
import android.database.DataSetObserver;
45
import android.os.Bundle;
56
import android.support.design.widget.TabLayout;
@@ -194,6 +195,10 @@ public void onSearchImageClicked(int index) {
194195
mediaDetails.showImage(index);
195196
forceInitBackButton();
196197
}
198+
@Override
199+
public void onConfigurationChanged(Configuration newConfig) {
200+
super.onConfigurationChanged(newConfig);
201+
}
197202

198203
/**
199204
* This method is called on Screen Rotation

0 commit comments

Comments
 (0)