android调用地图在2.4版本以后不再在init.mBMapMan.init(String apikey , new MyGeneralListener());中给定apikey,变为init.mBMapMan.init(String apikey , new MyGeneralListener());然后在manifest文件中application内添加<meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:name="com.baidu.lbsapi.API_KEY"
android:value="a7GS4tG6hRVAvmzXA4u5x5xn" />value的值是apikey,
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="a7GS4tG6hRVAvmzXA4u5x5xn" />
<activity
android:name="com.example.map.MainActivity"
android:label="@string/app_name"
android:screenOrientation="sensor"
android:configChanges="orientation|keyboardHidden"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>