Let us consider that i have 2 fragment a & b
Fragment a contains view pager, horizontal grid view and buttons images etc with scroll.
When i click a item in Fragment a
it goes to fragment b
and when i click on back button in fragment b
it comes back to fragment a
. Is all working perfect.
My issue is in back press of the fragment b
, it load the fragment a
from begin. I would like to show the exact place on fragment a
(say bottom) where the transaction begin.
I am doing all the fragment transaction in adapter of each item and code is like below.
Bundle arguments = new Bundle();
Fragment fragment = null;
MyClass cls= (MyClass ) obj.get(position);
arguments.putParcelable("single", offer);
// Start a new fragment
fragment = new DetailFragment();
fragment.setArguments(arguments);
FragmentTransaction transaction = activity .getSupportFragmentManager().beginTransaction();
transaction.setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
transaction.replace(R.id.content_page_frame, fragment, OfferZoneDetailFragment.ARG_ITEM_ID);
transaction.addToBackStack(DetailFragment.ARG_ITEM_ID);
transaction.commit();
How to load the fragment transaction begin position when came back from other fragment.