我的地图活动在启动时崩溃。我已经包含了所有的权限,并且在一个新的独立的地图项目上进行了测试,它与底层代码很好地协作。地图活动在调用时崩溃!
相反,当我在应用程序中合并相同的代码时,只要调用此活动就会崩溃。我的一个项目提交明天早上有,所以请尽快回复
我的地图活动如下
package com.healthcare.iFind;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.MapView.LayoutParams;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
public class MapsActivity extends MapActivity
{
MapView mapView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.maps);
mapView = (MapView) findViewById(R.id.mapView);
LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);
View zoomView = mapView.getZoomControls();
zoomLayout.addView(zoomView,
new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
mapView.displayZoomControls(true);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
我的AndroidManifest.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.healthcare.iFind"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".HomeScreen"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="MessageList"></activity>
<activity android:name="RateDoctor"></activity>
<activity android:name="RateQuiz"></activity>
<activity android:name="DetailedDoctor"></activity>
<activity android:name="DoctorProfile"></activity>
<activity android:name=".MapsActivity"/>
</application>
我maplayout.xml文件。
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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:enabled="true"
android:clickable="true"
android:apiKey="mykey"
/>
<LinearLayout android:id="@+id/zoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>
请不要说你的问题很紧急;它不会加速事情。如何提出问题智能方法 - http://www.catb.org/esr/faqs/smart-questions.html#urgent - 建议阅读任何人在这些社区网站上寻求帮助。 – junkdog 2010-10-19 06:58:50
这就是说,你的logcat说什么?它应该说错误发生在哪里 - 如果您使用的是Eclipse,请转到DDMS视角。 – junkdog 2010-10-19 07:01:35
它说,无法解析超级类的Lcom/healthcare/iFind/MapsActivity;它基本上显示了一个NoClassDefFoundError。但是我包含了Google API + Android 2.2包,并且在我的Eclipse代码中也没有出现错误。我能做什么错了?对于这种紧急情况,我很抱歉,我一直在研究这个问题,而且我没有让我的应用看起来很笨,我不会再这样做。 – standroid 2010-10-19 13:23:28