在边学边做一个和MapView相关的例子,但是程序stopped unexpectedly,
查看DDMS中出错的原因为:
05-23 03:07:09.844: WARN/dalvikvm(992): Unable to resolve superclass of Lcom/join/joy/EarthquakeDetailsView; (14)
05-23 03:07:09.844: WARN/dalvikvm(992): Link of class 'Lcom/join/joy/EarthquakeDetailsView;' failed
05-23 03:07:09.854: ERROR/dalvikvm(992): Could not find class 'com.join.joy.EarthquakeDetailsView', referenced from method com.join.joy.EarthquakeWatcher$1.onItemLongClick
错误为找不到继承自MapActivity的那个class,但是根据之前的警告信息“Unable to resolve superclass of”
知道原因是找不到这个class的superclass。
因为用了和Google map相关的类,而Google map是单独的library,需要导入之后才能使用,
因此在manifest.xml文件中的<application></application>里边添加
<uses-library android:name="com.google.android.maps"/>即可解决。
查看DDMS中出错的原因为:
05-23 03:07:09.844: WARN/dalvikvm(992): Unable to resolve superclass of Lcom/join/joy/EarthquakeDetailsView; (14)
05-23 03:07:09.844: WARN/dalvikvm(992): Link of class 'Lcom/join/joy/EarthquakeDetailsView;' failed
05-23 03:07:09.854: ERROR/dalvikvm(992): Could not find class 'com.join.joy.EarthquakeDetailsView', referenced from method com.join.joy.EarthquakeWatcher$1.onItemLongClick
错误为找不到继承自MapActivity的那个class,但是根据之前的警告信息“Unable to resolve superclass of”
知道原因是找不到这个class的superclass。
因为用了和Google map相关的类,而Google map是单独的library,需要导入之后才能使用,
因此在manifest.xml文件中的<application></application>里边添加
<uses-library android:name="com.google.android.maps"/>即可解决。