user3531909
user3531909

Reputation: 109

Fragment Back Navigation Issue

Here I little confuse with Fragments,

I create a one Activity-'A'. Add Fragment-'X' in Activity. Replace Fragment-'Y' in place of Fragment-'X' Now i want to open Fragment-'X' with saved state in Activity-'A'.

Please help me,

Thanks in Advance.

Upvotes: 0

Views: 63

Answers (2)

Subhalaxmi
Subhalaxmi

Reputation: 5707

Use in onBackPressed()

FragmentManager fm = getActivity().getSupportFragmentManager();
            fm.popBackStack();

and for more details check link!!!

Upvotes: 2

Aritra
Aritra

Reputation: 436

    To open fragment x from fragment y use the code....

getActivity().getSupportFragmentManager().popBackStack();

Upvotes: 1

Related Questions