0

Android マップ アプリケーションを試しています。実行すると、コードにエラーや問題はありません。samsung galaxy s3 を使用してテストしましたが、「残念ながら、マップが停止しました」と表示され続けます。

ここに私のJavaファイルがあります

package com.maps;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;

public class Main extends MapActivity {

MapView map;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    map = (MapView) findViewById(R.id.mvMain);
}

@Override
protected boolean isRouteDisplayed() {
    // TODO Auto-generated method stub
    return false;
}

}

ここに私のxmlコードがあります

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<com.maps.MapView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:apiKey="AIzaSyAfv657yXaBMlBLAe2pw0VyJiPLiczDG7E"
    android:id="@+id/mvMain"/>

</LinearLayout>

これが私のマニフェストです

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.maps"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
  />
<uses-permission android:name="android.permission.INTERNET"/>


<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <uses-library android:name="com.google.android.maps"/>
    <activity
        android:name="com.maps.Main"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

</manifest>
4

3 に答える 3

0

GOOGLE API が有効でない場合、地図は表示されません。エラーを修正できるように、manifest.xml ファイルを添付してください。それ以外の場合は、マニフェスト ファイルに GOOGLEapi の参照が含まれているかどうかを確認してください。

于 2013-06-28T09:50:15.913 に答える