【发布时间】:2014-04-08 01:08:42
【问题描述】:
我正在尝试在我的设备上运行这个非常简单的应用程序(使用地图 API V2),并且出于某种原因尝试使用 MapView:
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="(i did put the correct key)"
android:id="@+id/mvMap"/>
使用 java 文件:
public class MainMap extends MapActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map_layout);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
图块无法加载!! 但是当我使用片段时: 分段 android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="fill_parent" android:layout_height="fill_parent" />
with - 在 java 文件中扩展 FragmentActivity 它工作得非常好......
这是怎么回事???
【问题讨论】:
标签: java android google-maps android-fragments