When i add fragment and go to Fragment2 from Fragment1 with this code:
Bundle bundle = new Bundle();
bundle.putString(Constants.USER_NAME, item_username);
AppCompatActivity activity = (AppCompatActivity) view.getContext();
Fragment myFragment = new Fragment2();
myFragment.setArguments(bundle);
activity.getSupportFragmentManager().beginTransaction().add(R.id.frame_fragment_containers, myFragment).addToBackStack(null).commit();
I can't check onPause and onDestroy in Fragment1 and onResume in Fragment1 when i come back from Fragment2. I want do this with add and don't use replace. Please help me. Thanks