【Android】保存Fragment切换状态
一、应用场景 1、不使用ViewPager 2、不能用replace来切换Fragment,会导致Fragment释放(调用onDestroyView) 二、实现 1、xml < LinearLayout xmlns:android ="http://schemas.android.com/apk/res/android" android:layout_width ="match_parent" android:layout_height ="match_parent" android:orientation ="vertical" > < FrameLayout android:id ="@+id/container" android:layout_width ="match_parent" android:layout_height ="0dip" android:layout_weight ="1.0" > </ FrameLayout > < RadioGroup android:id ="@+id/main_radio"...