我的清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yousystem.loyalties"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17"/>
<permission
android:name="com.yousystem.loyalties.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="com.yousystem.loyalties.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:name=".LocalApplication">
<activity
android:name=".LoginActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".MasterActivity"
android:clearTaskOnLaunch="true"
android:screenOrientation="portrait"/>
<activity
android:name=".PromotionsActivity"
android:clearTaskOnLaunch="true"
android:screenOrientation="portrait"/>
<activity
android:name=".NewsAndPromotionsDetailsActivity"
android:clearTaskOnLaunch="true"
android:screenOrientation="portrait"/>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="myKey" />
</application>
</manifest>
我的片段
import com.google.android.gms.maps.SupportMapFragment;
public class LocationsFragment extends SupportMapFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View view = super.onCreateView(inflater, container, savedInstanceState);
// initMap();
return view;
}
}
可以看到带有缩放控件的空白屏幕,这是怎么回事?
EDIT1: com.yousystem.loyalties E/Google Maps Android API:加载地图失败。联系 Google 服务器时出错。这可能是身份验证问题(但可能是由于网络错误)。
EDIT2:修复了<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
现在我无法联系 Google 服务器的 Edit1 错误。建立连接后将进行另一次尝试。