Here's the Overview:

main.xml: (landscape mode)
---------
Has two fragments with id "fragment1 and "fragment2" placed
horizontally in a linearlayout

main.xml:(Portrait mode)
------------------------
Has two fragments with id "fragment1 and "fragment2" placed Vertically
in a linearlayout

fragment1.xml
-------------
1.TextView
2.EditText(etxt_Fragment1)

fragment2.xml
-------------
1.TextView
2.Button(btn_Fragment2)

fragment3.xml
-------------
1.TextView
2.Button(btn_Fragment3)

fragment4.xml
-------------
1.TextView

What i wanted is:
-----------------
Initially fragment1 and fragment2 will be shown to the user.
On clicking on the button in fragment2, fragment1 will be replaced by
fragment3 so, it has fragment3 and fragment2(fragment1 is added to the
backstack). Now if i click on button in fragment3, fragment2 will be
replaced by fragment4.

FYI:
---
I am saving the state of etxt_Fragment1 using Bundle in
onSaveInstanceState and retrieving it back in onActivityCreated in
Fragment1.java which is a subclass of Fragment

Problem:
--------
1. fragment1 and fragment2 are shown in Landscape mode
2. Type some text in edittext in fragment1
3. click on button in fragment2 which replaces the fragment1 with
fragment3 so, now fragment3 and fragment2 are shown.
4.change orientation to portrait mode
5.change orientation back to landscape mode (Till here if i check the
logcat, the bundle is saved properly)
6.Now, if i click on the back button in the device, it should show
fragment1 with the text i typed before and fragment2 but, the bundle
returns null.

Hope i have explained my problem so kindly provide me the solution.

I am attaching my complete project for you to have a better
understanding.

Waiting for your reply...

Thanks & Regards,
ksat8384.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to