0

I'm trying to pass a String contained in data [0] into another fragment, but the replace () method gives me this error: replace(int, android.app.Fragment)' in 'android.app.FragmentTransaction' cannot be applied to '(int, androidx.fragment.app.Fragment)

                                Bundle bundle = new Bundle();
                                bundle.putString("key", data[0]);
                                Fragment fragment;
                                fragment = new AccountFragment();
                                fragment.setArguments(bundle);
                                getFragmentManager().beginTransaction().replace(R.id.my_account, fragment).commit();``` 
Yonder
  • 1

0 Answers0