I have created a map in fragment. If i call the map at first it displays map but when i call some other activity and again if i call the map fragment it doesn't view the map. How to fix the issue? Please help me.
Asked
Active
Viewed 227 times
0
-
It's not best practice to multiple map fragments – VINIL SATRASALA Jan 02 '14 at 08:40
-
in my application i have two fragments A and B in which i have to call map fragment in both the fragments.If it possible how to proceed further?? – june Jan 02 '14 at 08:44
-
May be you haven't saved state of Fragments or back states. – Piyush Jan 02 '14 at 08:45
-
@PiyushGupta Can you explain more about that? – june Jan 02 '14 at 08:48
-
If you are in A fragment , there you have a map, From there you are going to B fragment then destroy map in A fragment – VINIL SATRASALA Jan 02 '14 at 08:49
-
FragmentManager fm = getSupportFragmentManager(); Fragment fragment = (fm.findFragmentById(R.id.map)); FragmentTransaction ft = fm.beginTransaction(); ft.remove(fragment); ft.commit(); – VINIL SATRASALA Jan 02 '14 at 08:49
-
see this http://stackoverflow.com/questions/11798620/saving-the-state-of-fragments http://stackoverflow.com/questions/6787071/android-fragment-how-to-save-states-of-views-in-a-fragment-when-another-fragmen http://stackoverflow.com/questions/15965341/save-restore-fragments-state-android – Piyush Jan 02 '14 at 08:49
-
@VINILSATRASALA where to use these code? – june Jan 02 '14 at 08:56
-
@june: OnDestroy you can use this code – VINIL SATRASALA Jan 02 '14 at 08:59