I have set up an Android Application in order to view some things on a Google Map. I used the Google Maps API v2 and followed all the setup which can be found here. I even registered the application using a key that I applied for on Google's website.
I have been able to get the Activity running but every time I open it I am greeted with a blank screen.
This is my Manifest File
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stullich.tim.woistmeinphoto"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<permission
android:name="com.stullich.tim.woistmeinphoto.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.stullich.tim.woistmeinphoto.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:required="true"
android:name="android.test.runner">
</uses-library>
<activity
android:name="com.stullich.tim.woistmeinphoto.PhotoGalleryActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".FullImageViewActivity"
android:screenOrientation="landscape" >
</activity>
<activity android:name=".MapViewActivity"
android:screenOrientation="landscape" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="Excluded this for now" />
</application>
And This Is My Activity Where I Load The Map
package com.stullich.tim.woistmeinphoto;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.maps.SupportMapFragment;
public class MapViewActivity extends FragmentActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.map_view_activity);
SupportMapFragment fragment = new SupportMapFragment();
getSupportFragmentManager().beginTransaction()
.add(android.R.id.content, fragment).commit();
}
}
I have heard that not having the correct API Key used can lead to this problem, but I have triple-checked the key now and I don't think that is the issue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…