Fragments life cycle - Error

0

Good day My application consists of an activity where a Fragment (F) is initially loaded

getSupportFragmentManager()
            .beginTransaction()
            .add(R.id.content_frame, newFragment).commit();

F contains 3 buttons, each of these buttons redirects to another fragment (F1, F2, F3). In turn, F2 contains a RecyclerView that redirects to another fragment (F2a) with certain data.

        getActivity().getSupportFragmentManager()
            .beginTransaction()
            .replace(R.id.content_frame, fragment)
            .addToBackStack(null)
            .commit();

F2a passes several times through its OnCreateView even though it is displaying another fragment. until there comes a time where it breaks down because it can not match its elements. What could it be?

For what it's worth, I clarify that I use a back button located in the Activity

super.onBackPressed();

and that to binde the elements use ButterKnife

    
asked by DavidC 02.12.2018 в 15:00
source

0 answers