Merhaba,
Android tab menülerden birinde fargment için google map kullandım. Menüler arası geçişte (fragments arası geçişte) bir hatayla karşı karşıya kaldım. Çözümünü nette çok aradığım halde bir çözüme ulaşamadım ve kendi yöntemimle hatayı çözmeyi başardım. Sorunsuz bir şekilde menüler arası geçiş yapabiliyorum. Umarım bu tür hatayla karşılaşanlara bir nebze olsun yarar sağlar.
Hello,
I use google map for fargment in one of the Android tab menu. The transition between menu items ( the transition between fragments ) I faced an error. Although I could not get a clear solution and the solution I was looking for so I was able to resolve the error in my own way . You can seamlessly switch between menus. I hope those who experience this type of error provides a modicum get benefits
1 2 3 4 5 6 7 8 9 10 | @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub View1 = inflater.inflate(R.layout.fragment1, container, false); // Google Map here ... return View1; } |
Çözümü :
Solution :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | @Override public void onDestroyView() { // TODO Auto-generated method stub SupportMapFragment ftemp = (SupportMapFragment) getChildFragmentManager() .findFragmentById(R.id.map1); // map in layout if (ftemp != null) { try { getFragmentManager().beginTransaction().remove(ftemp).commit(); } catch (Exception e) { e.printStackTrace(); } } super.onDestroyView(); } |