Skip to content

Commit

Permalink
Fix bugly #501. IllegalStateException occured on orientation change. …
Browse files Browse the repository at this point in the history
…Because fragment was added twice. Using FrameLayout instead of Fragment. See full solution at http://stackoverflow.com/a/29556331.
  • Loading branch information
Zhongyi Tong committed May 31, 2016
1 parent 8317ad9 commit 229357b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/main/res/layout/activity_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@
android:padding="6dp" android:src="@mipmap/ic_refresh"
android:layout_alignBottom="@+id/settings_bar"/>
</RelativeLayout>
<fragment android:layout_width="match_parent"
<FrameLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/preferences_fragment"
tools:layout="@android:layout/simple_list_item_1"
class="xyz.monkeytong.hongbao.fragments.GeneralSettingsFragment"/>
tools:layout="@android:layout/simple_list_item_1"/>
</LinearLayout>

0 comments on commit 229357b

Please sign in to comment.