0

code for fragment of maps

public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {



    View rootView = inflater.inflate(R.layout.map_fine_tech, container, false);



    return rootView;
}
    @Override
public void onDestroy() {
    // TODO Auto-generated method stub
    try{

    if (fragment != null) {

         fragment =  getFragmentManager().findFragmentById(R.id.map);
           FragmentTransaction ft = getActivity().getFragmentManager().beginTransaction();
           ft.remove(fragment);
           ft.commit();
    }
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
     Thread.interrupted();

} 
M D
  • 47,665
  • 9
  • 93
  • 114
Deep Singh
  • 147
  • 1
  • 3
  • 16
  • Used `onDestroyView()` instead of `onDestroy()` – M D Jan 27 '15 at 07:07
  • @MD May be `onPause()` instead of `onDestroyView()` – SMR Jan 27 '15 at 07:13
  • @MD it crashes when i come back to maps from another fragment.now i used ondestroyview() ..can we do some change in oncreateview – Deep Singh Jan 27 '15 at 08:08
  • @MD it worked thanks ...but now i have one more problem ..app crashes when i clicked twice on map option ..i searched it lot ..but i did,t get a solution ..i m using maps in fragment in sliding drawer – Deep Singh Feb 03 '15 at 12:10
  • @SMR it worked thanks ...but now i have one more problem ..app crashes when i clicked twice on map option ..i searched it lot ..but i did,t get a solution ..i m using maps in fragment in sliding drawer – Deep Singh Feb 03 '15 at 12:12
  • @DeepSingh post a new question with detailed description of the problem – SMR Feb 04 '15 at 04:48
  • @SMR problem is that ...i m using a sliding drawer .in the sliding drawer there is no of fragments ..there is one fragment of map ..now if i clicked twice on the sliding drawer on map fragment option ..map got crash ... – Deep Singh Feb 04 '15 at 06:49
  • http://stackoverflow.com/questions/20094482/duplicated-id-with-fragment plz check this link ,same kind of code i m using .. @SMR – Deep Singh Feb 04 '15 at 06:55
  • @SMR http://stackoverflow.com/questions/28523014/how-to-implement-signout-functionality-in-integration-in-social-auth-in-android ..can u help me in this – Deep Singh Feb 15 '15 at 04:35

0 Answers0