1

アプリに Google Maps API をインストールしています。すべてが実行されており、Google マップ アクティビティを起動できますが、マップが表示されません。ズームインおよびズームアウトできるグリッドが表示されるだけです。

    package com.fotolife.app;

import android.os.Bundle;

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

public class Map extends MapActivity {

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

    @Override
    protected void onCreate(Bundle arg0) {
        // TODO Auto-generated method stub
        super.onCreate(arg0);
        setContentView(R.layout.map);


    }


}

^ それが私の Map.java です

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

    <com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mapview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="I Took this out for security reasons, but it works."
/>

</LinearLayout>

^これが私のmap.xmlです

助けてくれてありがとう!

4

2 に答える 2

1

こんにちは、これは私のために働いた:

API キーをどこで取得したか覚えていますか? https://code.google.com/apis/consoleに移動し、[Android アプリのキー (証明書付き)] の下で、許可されている Android アプリの編集を押します。

私の場合、フィンガープリントは別のプロジェクトの古いパッケージを参照していたので、cmd コンソールに移動して新しいフィンガープリントを取得し、ビンゴの後に現在のパッケージ名を入力しました。

于 2014-11-23T22:05:38.537 に答える