title: Map activity in android
body: <p>I have created map actvity.But its not showing map on mapview.just showing blank blocks.
  is there any solution?</p>
  
  <p>activity_main.xml-</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:name="com.google.android.gms.maps.MapFragment"/&gt;
  </code></pre>
  
  <p>activity code-</p>
  
  <pre><code>package com.example.googlemap;
  
  
  import android.app.Activity;
  import android.os.Bundle;
  public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  }
  </code></pre>
  
  <p>manifest file-</p>
  
  <pre><code>  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="16" /&gt;
  
  &lt;permission
      android:name="com.example.googlemap.permission.MAPS_RECEIVE"
      android:protectionLevel="signature" /&gt;
  
  &lt;meta-data
      android:name="com.google.android.maps.v2.AIzaSyDRv4Ul_9iPW-roHIsc8EuxKwkRN8jWivs"
      android:value="AIzaSyDRv4Ul_9iPW-roHIsc8EuxKwkRN8jWivs" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&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;!--
   The following two permissions are not required to use
   Google Maps Android API v2, but are recommended.
  --&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
  &lt;uses-feature
      android:glEsVersion="0x00020000"
      android:required="true" /&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="com.example.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;uses-library android:name="com.google.android.maps" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>after using <a href="https://developers.google.com/maps/documentation/android/start" rel="nofollow">this</a>
  i'm getting following exception-</p>
  
  <pre><code>  08-22 23:19:52.204: E/AndroidRuntime(584): FATAL EXCEPTION: main
    08-22 23:19:52.204: E/AndroidRuntime(584): java.lang.RuntimeException: Unable to       start activity ComponentInfo{com.example.googlemap/com.example.googlemap.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
  </code></pre>