在我的工程里导入下面这个包装是会提示出错。
import com.google.android.maps.MapActivity;//提示:The import com.google cannot be resolved
这可是我从书中直接copy的啊。
我使用的是Android SDK 2.2 。。
请高手指教,使用MapView 编写google地图时需要导入那些包?
import com.google.android.maps.MapActivity;//提示:The import com.google cannot be resolved
这可是我从书中直接copy的啊。
我使用的是Android SDK 2.2 。。
请高手指教,使用MapView 编写google地图时需要导入那些包?
而应该使用Google APIs 2.2
我在main.xml中,加入以下视图,结果运行后,在模拟器中打开应用程序出错。真头疼啊。
<view class="com.google.android.maps.MapView"
android:id="@+id/myMap"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
<com.google.android.maps.MapView
android:id="@+id/myMap"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>这么写试试看!
原来要使用MapActivity扩展来替代Activity。
即:public class AndroidLBS2 extends MapActivity {}
并且要在Mainfest中加入
<uses-library android:name="com.google.android.maps" />