title: Google Map in fragment
body: <p>This is my fragment where I am displaying my street view and Google map and I am not able to do it because of the following error: <a href="http://i.stack.imgur.com/HJsUn.png" rel="nofollow">Screenshot of LogCat</a></p>
  
  <pre><code>FATAL EXCEPTION: main
  Process: com.wi.guiddoo, PID: 9788
  android.view.InflateException: Binary XML file line #12: Error inflating class fragment
  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
  at android.view.LayoutInflater.rInflate(LayouterInflater.java:755)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  at com.wi.guiddoo.fragments.RecommendationPagerSectionMap.onCreateView(RecommendationPagerSectionMap.java:48)
  at android.support.v4.app.Fragment.performCreateView(Fragment.java:1789)
  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:955)
  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)
  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)
  at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:490)
  at com.wi.guiddoo.utils.FragmentUtil.changeFragment(FragmentUtil.java:94)
  at com.wi.guiddoo.fragments.RecommendationPagerSection$5.onClick(RecommendationPagerSection.java:274)
  </code></pre>
  
  <p>I tried using <code>getChildFragmentManager</code> as well as <code>getSupportFragmentManager</code> but I am getting the same error. Also I used <code>SupportMapFragment</code> and <code>StreetViewPanoramaFragment</code> and get the same error.</p>
  
  <pre><code>package com.wi.guiddoo.fragments;
  
  public class RecomendationPagerSectionMap extends Fragment{
      double latitude,longitude;
      public String locationname;
      public View view;
      private GoogleMap googleMap;
      public TextView tv;
      public SupportStreetViewPanoramaFragment streetViewPanoramaFragment;
  
      public RecomendationPagerSectionMap(double Lat,double Long,String name){
          latitude=Lat;
          longitude=Long;
          locationname=name;
      }
  
       public RecomendationPagerSectionMap() {
          // TODO Auto-generated constructor stub
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          view = inflater.inflate(R.layout.fragment_recomendation_pager_section_maps, container, false);
          AppController.getInstance().trackScreenView(locationname.toUpperCase(Locale.US));
          init();
          return view;
      }
  
      public void init(){
          tv=(TextView)view.findViewById(R.id.textview_streetview);
          streetViewPanoramaFragment = (SupportStreetViewPanoramaFragment) getChildFragmentManager().findFragmentById(R.id.streetviewfragment);
          streetViewPanoramaFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {
  
              @Override
              public void onStreetViewPanoramaReady(final StreetViewPanorama streetview) {
                  // TODO Auto-generated method stub
                  streetview.setPosition(new LatLng(latitude, longitude),100);
              }
          });
          try {
              if (googleMap == null) {
                  googleMap = ((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map)).getMap();
              }
              googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
              googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), 17));
              googleMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).title(locationname.toUpperCase(Locale.US)));
              //TP.setPosition(SYDNEY);
      }
          catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <hr>
  
  <p>I am calling it from this fragment and it is not working:</p>
  
  <pre><code> public class RecomendationPagerSection extends Fragment implements OnClickListener {...
  
  
  
    public void sendLatLongtoMap(final double lati,final double loni,final String name){ 
  mapAndStreetView.setOnClickListener(new OnClickListener() { 
  public void onClick(View v) { 
  // TODO Auto-generated method stub 
      FragmentUtil.changeFragment(getActivity(),new RecomendationPagerSectionMap(lati,loni,name)); } }); }
  </code></pre>