2011-10-20 54 views
0

開始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

回答

0

你的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> 
0

檢查MapActivity在同文件夾?

,或者嘗試充分路徑表現爲

com.packagename.mapactivity 
+0

stil同樣的問題。 – Luciano

+0

檢查@adil的答案,應該可以解決您的問題 – MKJParekh