title: Error on layout fragment
body: <p>I Create google map application</p>
  
  <p>my layout is </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MainActivity" &gt;
  
  &lt;fragment
      android:id="@+id/map"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      class="com.google.android.gms.maps.MapFragment" &gt;
  &lt;/fragment&gt;
  </code></pre>
  
  <p></p>
  
  <p>Code is </p>
  
  <pre><code> map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
              .getMap();
  </code></pre>
  
  <p>StackTrace</p>
  
  <pre><code>FATAL EXCEPTION: main
  java.lang.RuntimeException: Unable to start activity ComponentInfo{ir.androiddev.googlemap/ir.androiddev.googlemap.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
  0at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:130)
  at android.app.ActivityThread.main(ActivityThread.java:3687)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:507)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
  at dalvik.system.NativeStart.main(Native Method)
  Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209)
  at android.app.Activity.setContentView(Activity.java:1657)
  at ir.androiddev.googlemap.MainActivity.onCreate(MainActivity.java:27)
  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
  Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/ir.androiddev.googlemap-1.apk]
  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  at android.view.LayoutInflater.createView(LayoutInflater.java:471)
  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:549)
  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
  </code></pre>
  
  <p>and my manifest</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="ir.androiddev.googlemap"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="19" /&gt;
  
  &lt;permission
      android:name="ir.androiddev.googlemap.permission.MAPS_RECEIVE"
      android:protectionLevel="signature" /&gt;
  
  &lt;uses-feature
      android:glEsVersion="0x00020000"
      android:required="true" /&gt;
  
  &lt;uses-permission android:name="ir.androiddev.googlemap.permission.MAPS_RECEIVE" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="ir.androiddev.googlemap.MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  
  &lt;meta-data
      android:name="com.google.android.maps.v2.API_KEY"
      android:value="My-API-key" /&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>and Code is </p>
  
  <pre><code>package ir.androiddev.googlemap;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  import com.google.android.gms.maps.model.BitmapDescriptorFactory;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.Marker;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  import android.widget.Toast;
  
  public class MainActivity extends Activity {
  static final LatLng HAMBURG = new LatLng(35.724543, 51.407633);
  private GoogleMap googleMap;
  private GoogleMap map;
  // latitude and longitude
  double latitude = 35.724543;
  double longitude = 51.407633;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
              .getMap();
  
      Marker kiel = map.addMarker(new MarkerOptions()
              .position(HAMBURG)
              .title("Dana Ravesh")
              .snippet("Tehran ...")
              .icon(BitmapDescriptorFactory
                      .fromResource(R.drawable.ic_launcher)));
  
      // Move the camera instantly to hamburg with a zoom of 15.
      map.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));
  
      // Zoom in, animating the camera.
      map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
  }
  
  private void initilizeMap() {
      if (googleMap == null) {
          // create marker
          MarkerOptions marker = new MarkerOptions().position(
                  new LatLng(latitude, longitude)).title("Dana Ravesh ");
  
          // adding marker
          googleMap.addMarker(marker);
          googleMap = ((MapFragment) getFragmentManager().findFragmentById(
                  R.id.map)).getMap();
  
          // check if map is created successfully or not
          if (googleMap == null) {
              Toast.makeText(getApplicationContext(),
                      "Sorry! unable to create maps", Toast.LENGTH_SHORT)
                      .show();
          }
      }
  }
  
  @Override
  protected void onResume() {
      super.onResume();
      initilizeMap();
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  }
  </code></pre>