I have multiple fragments in my app,ok lets say i have fragment f1 and f2..now in f1 i have imageview and buttons,now if click on button it goes to f2 and display f2,but in background the view of the f1 is still visible,can any one tell what is the issue with fragments in my app,thanks in advance
Fragment 1 button's listener
Shopfragment is second Fragment
hp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ShopFragment tf = new ShopFragment();
Bundle bundle = new Bundle();
tf.setArguments(bundle);
android.app.FragmentManager fm = getActivity().getFragmentManager();
android.app.FragmentTransaction ft = fm.beginTransaction();
ft.replace(R.id.container_body, tf);
ft.setTransition(android.support.v4.app.FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
ft.addToBackStack(null);
ft.commit();
}
});