<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
由于<舱单的孩子>。
我:
<uses-library android:name="com.google.android.maps" />
由于<应用程序的孩子>。
myview.xml包含:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/secondaryColor"
>
<com.google.android.maps.MapView
android:layout_width="260dp"
android:layout_height="100dp"
android:apiKey=OMMITTED
android:id="@+id/mapView"/>
</RelativeLayout>
MyView.java:
public class MyView extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.myview);
}
}
当我运行程序时,我得到一个 “源未找到” 错误什么也没有在控制台或logcat的。当我取出整个com.google.android.maps.MapView标记时,程序运行良好。我使用目标“Google API API Level 7”运行模拟器。我的项目构建目标是API级别7的“Google API”。我在这一点上陷入困境!
我觉得很蠢。完全忽略扩展MapActivity! – ninjaneer