|
|
@@ -153,8 +153,6 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private List<Fragment> fragmentList = new ArrayList<>();
|
|
|
-
|
|
|
private int lastPosition = MainTab.FgtSmallSheep.ordinal();//默认选中小绵羊
|
|
|
|
|
|
//多次点击预防
|
|
|
@@ -170,7 +168,6 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
if (fragment == null) {
|
|
|
fragment = mainTabs[index].getFragment();
|
|
|
}
|
|
|
- fragmentList.add(fragment);
|
|
|
if (!fragment.isAdded()) {
|
|
|
transaction.add(R.id.frame_container, fragment, "fragment_" + index);
|
|
|
}
|
|
|
@@ -248,9 +245,7 @@ public class ActMain extends BaseActYmPermissionCheck {
|
|
|
*/
|
|
|
private void doBackPress() {
|
|
|
if (System.currentTimeMillis() - mLastBackTime < 1000) {
|
|
|
- fragmentList.clear();
|
|
|
- fragmentList = null;
|
|
|
- fragmentList = getSupportFragmentManager().getFragments();
|
|
|
+ List<Fragment> fragmentList = getSupportFragmentManager().getFragments();
|
|
|
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
|
|
for (Fragment fragment : fragmentList) {
|
|
|
try {
|