如何从活动

问题描述:

开始MapActvity我试图从正常活动启动地图活动。 但不断收到错误:如何从活动

10-20 10:47:08.828: ERROR/dalvikvm(1102): Could not find class 'com.xxApp.MapAnalyseActivity', referenced from method com.xxApp.xxAppActivity$1.run 
10-20 10:47:11.578: ERROR/AndroidRuntime(1102): java.lang.NoClassDefFoundError: com.xxApp.MapAnalyseActivity 

当我尝试这样做:

startActivity(new Intent(xxAppActivity.this, MapAnalyseActivity.class)); 
xxAppActivity.this.finish(); 

这里是我的清单

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.xxApp" 
    android:versionCode="1" 
    android:versionName="1.0"> 
<uses-sdk android:minSdkVersion="7" /> 
<uses-permission android:name="android.permission.INTERNET" /> 

<application android:icon="@drawable/icon" android:label="@string/app_name"> 
    <activity android:name=".xxAppActivity" android:label="@string/app_name" android:theme="@style/xxTheme"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 


    <activity android:label="@string/mapAnalyse" android:name="MapAnalyseActivity" android:configChanges="orientation|keyboardHidden" android:theme="@style/xxTheme"> 
     <intent-filter> 
      <action android:name="com.xxApp.MapAnalyseActivity" /> 
     </intent-filter> 
    </activity> 


</application> 

+3

安置自己的表现了。 – Reno

你的manifest.xml应该是这样的

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.xxApp" 
    android:versionCode="1" 
    android:versionName="1.0"> 
    <uses-sdk android:minSdkVersion="7" /> 
    <application android:icon="@drawable/icon" android:label="@string/app_name"> 

     <activity android:name=".xxAppActivity" android:label="@string/app_name" android:theme="@style/xxTheme"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 

     <activity android:label="@string/mapAnalyse" android:name="MapAnalyseActivity" android:configChanges="orientation|keyboardHidden" android:theme="@style/xxTheme"/> 

     <uses-library android:name="com.google.android.maps"/>    
    </application> 
    <uses-permission android:name="android.permission.INTERNET" /> 
</manifest> 

检查MapActivity在同文件夹?

,或者尝试充分路径表现为

com.packagename.mapactivity 
+0

stil同样的问题。 – Luciano

+0

检查@adil的答案,应该可以解决您的问题 – MKJParekh