作者: | 来源:互联网 | 2023-09-18 19:59
例如:
android:name="com.xxx.xxx"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Guahao" >
android:name="BaiduMapKey"
android:value="2T6A2EwXRRn5WLFpGYSvIGqp" />
获取:
public String getMapKey() {
String keyString = "";
try {
ApplicationInfo appInfo = getPackageManager().getApplicationInfo(getPackageName(),
PackageManager.GET_META_DATA);
keyString = appInfo.metaData.getString("BaiduMapKey");
} catch (NameNotFoundException e) {
e.printStackTrace();
}
return keyString;
}