如何夸大com.google.android.maps.MapView类?

时间:2015-10-08 08:29:17

标签: android google-maps google-maps-android-api-2

我的MapActivity中有类com.google.android.maps.MapView的实例(mv)。我用mv= (com.google.android.maps.MapView) findViewById(R.id.mvId);

初始化它

现在,在我的xml布局文件中,mapview定义如下:

<com.google.android.gms.maps.MapView
    android:id="@+id/mvId"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

导致classCastException应该是这样。 现在,如果我正在使用这样的mapview布局 -

<com.google.android.maps.MapView
    android:id="@+id/mvId"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

这显示了Class Inflating Exception。

请注意必须在MapActivity中使用com.google.android.maps.MapView的实例。我该怎么办?有没有办法在两个地图视图之间进行投射或如何在布局文件中膨胀类com.google.android.maps.MapView。 gms.maps.MapView和maps.MapView之间有什么区别?

0 个答案:

没有答案