How to call a fragment from a fragment?

I use fragment , and I open another view in the same fragment that it opens correctly. But the problem is that I can’t get it, how to return to the first form.

If I call fragment object of the first fragment, it deletes the old value, which is similar to Edittext or other data.

Can anyone help me?

It works like

I call the first fragment of the fragone name and paste some value into this in the Edittext , now I want to open another view using the fragment in the same named fragment, Now I want to switch to fragone, so what can I do for that ????

+8
android android-fragments
source share
2 answers

I am using Fragment on android3.0 (Tab app) in which I got this how it worked.

 Fragment duedateFrag = new DuedateFrag(true); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.main_tasklistdetail_lay, duedateFrag); ft.addToBackStack(null); ft.commit(); 
+9
source share

You can use setTargetFragment . An example is available here.

+3
source share

All Articles