我一直在尝试在 android 中使用谷歌地图。
但是应用程序崩溃了。 :(
这是我的xml代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0E8T-qQndWDg8lEScymvQro3kJ1bGlSKLolDE3Q"
/>
</LinearLayout>
我已经包括(之后):
<uses-permission android:name="android.permission.INTERNET" />
还有(之后):
<uses-library android:name="com.google.android.maps" />
我找不到任何错误。
最佳答案
只需要扩展 MapActivity 而不是 Activity。
关于android - 谷歌地图 (com.google.android.maps) 使应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6300578/