0

Android用のGoogleマップAPI v2を使用しようとしていますが、これらの指示に正確に従いました

https://developers.google.com/maps/documentation/android/start

このコードをレイアウトファイルに入れるまで、すべて正常に動作します

<fragment
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.MapFragment" />

そのコードがアプリに配置されると、開いたときにクラッシュし、この画像もグラフィカル レイアウトに表示されますここに画像の説明を入力

前もって感謝します!

4

1 に答える 1

1

サポートを利用するMapfragment

<fragment     
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:name="com.google.android.gms.maps.SupportMapFragment"
          />

GoogleMap gm;

  gm = ((SupportMapFragment(getSupportFragmentManager().findFragmentById(R.id.map))).getMap();    
  gm.setMapType(GoogleMap.MAP_TYPE_NORMAL);
于 2013-04-20T04:31:26.743 に答える