title: Android Map integration exception
body: <p>i am new on android and i have tried to integrate the google maps with my application , i tried vogella and androidhive also and seen the questions and answers on the stack overflow but nothing works here is the android code </p>
  
  <pre><code>    private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; //10 metters
  
      //The minimum time beetwen updates in milliseconds
      private static final long MIN_TIME_BW_UPDATES = 1000 * 60 * 1; // 1 minute
      @SuppressLint("NewApi")
      @Override
      protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      this.requestWindowFeature(Window.FEATURE_NO_TITLE);
      setContentView(R.layout.mainscreen);
      // .findFragmentById(R.id.map))
      map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
  
          if (map!=null){
            Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)
                .title("Hamburg"));
            Marker kiel = map.addMarker(new MarkerOptions()
                .position(KIEL)
                .title("Kiel")
                .snippet("Kiel is cool")
                .icon(BitmapDescriptorFactory
                    .fromResource(R.drawable.ic_launcher)));
          }
  
  }
  </code></pre>
  
  <p>Here is the xml code </p>
  
  <pre><code>&lt;fragment 
  android:id="@+id/map"
  android:name="com.google.android.gms.maps.MapFragment"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  class="com.google.android.gms.maps.SupportMapFragment" /&gt;
  </code></pre>
  
  <p>And here i have the exceptions please tell me where i am wrong </p>
  
  <pre><code>01-21 23:26:47.304: E/AndroidRuntime(1456): FATAL EXCEPTION: main
  01-21 23:26:47.304: E/AndroidRuntime(1456): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.geekdev.animalpark/com.geekdev.animalpark.MainScreen}: android.view.InflateException: Binary XML file line #54: Error inflating class fragment
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.os.Handler.dispatchMessage(Handler.java:99)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.os.Looper.loop(Looper.java:137)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.ActivityThread.main(ActivityThread.java:5041)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at java.lang.reflect.Method.invokeNative(Native Method)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at java.lang.reflect.Method.invoke(Method.java:511)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at dalvik.system.NativeStart.main(Native Method)
  01-21 23:26:47.304: E/AndroidRuntime(1456): Caused by: android.view.InflateException: Binary XML file line #54: Error inflating class fragment
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.Activity.setContentView(Activity.java:1881)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at com.geekdev.animalpark.MainScreen.onCreate(MainScreen.java:57)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.Activity.performCreate(Activity.java:5104)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     ... 11 more
  01-21 23:26:47.304: E/AndroidRuntime(1456): Caused by: java.lang.ClassCastException: com.google.android.gms.maps.SupportMapFragment cannot be cast to android.app.Fragment
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.Fragment.instantiate(Fragment.java:585)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.Fragment.instantiate(Fragment.java:560)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at android.app.Activity.onCreateView(Activity.java:4709)
  01-21 23:26:47.304: E/AndroidRuntime(1456):     at    android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
  
  
   &lt;uses-sdk
      android:minSdkVersion="17"
      android:targetSdkVersion="17" /&gt;
  &lt;permission
      android:name="com.geekdev.animalpark.permission.MAPS_RECEIVE"
      android:protectionLevel="signature" /&gt;
   &lt;uses-feature
      android:glEsVersion="0x00020000"
      android:required="true" /&gt;
   &lt;uses-permission android:name="com.geekdev.animalpark.permission.MAPS_RECEIVE" /&gt;
  
   &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
   &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
   &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
   &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  
  
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
          &lt;!-- Goolge Maps API Key --&gt;
  &lt;meta-data
      android:name="com.google.android.maps.v2.API_KEY"
      android:value="AIzaSyCSzy5IWRWvMUn8xt5I17Z-1l7xtzYM0Js" /&gt;
  </code></pre>
  
  <p>i have tried everything that i found on the internet but nothings work here please tell me the appropriate solution for this please please </p>