小编Cap*_*npa的帖子

如何修复“FragmentManager 已在执行事务”错误?

自从我更新了我的应用程序实现以来,我发现自己无法使用该应用程序。

我收到“java.lang.IllegalStateException:FragmentManager 已经在执行事务”错误,并且似乎找不到此问题的解决方案...

public class MainActivity extends AppCompatActivity {

private Toolbar mainToolbar;
private FirebaseAuth mAuth;
private FirebaseFirestore firebaseFirestore;
private String current_user_id;
private BottomNavigationView mainbottomNav;
private HomeFragment accountFragment;
private NotificationFragment notificationFragment;
private FilterFragment filterFragment;
private UserProfileFragment userProfileFragment;
private MapFragment homeFragment;
private static final String TAG = "MainActivity";



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mAuth = FirebaseAuth.getInstance();
    firebaseFirestore = FirebaseFirestore.getInstance();


    if (mAuth.getCurrentUser() != null) {
        current_user_id = mAuth.getCurrentUser().getUid();
        mainbottomNav = findViewById(R.id.mainBottomNav);
        BottomNavigationViewHelper.disableShiftMode(mainbottomNav);


        BottomNavigationMenuView bottomNavigationMenuView =
                (BottomNavigationMenuView) mainbottomNav.getChildAt(0);
        View v = …
Run Code Online (Sandbox Code Playgroud)

java android fragmenttransaction fragment-lifecycle google-cloud-firestore

5
推荐指数
0
解决办法
1655
查看次数