2013-01-03 40 views
0

我使用2菜單項,第一個菜單項發送全球問候 &第二項爲設置, 每當我在設置菜單項時,我總是收到以下信息,請點擊:的Android Unforunately應用程序已經停止

不幸的是應用程序已經停止

logcat的說:

01-03 16:20:38.102: E/AndroidRuntime(953): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.january.floogoo/android.media.audiofx.BassBoost$Settings}; have you declared this activity in your AndroidManifest.xml? 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.Activity.startActivityFromChild(Activity.java:3843) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.Activity.startActivityFromChild(Activity.java:3819) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.Activity.startActivityForResult(Activity.java:3395) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.Activity.startActivityForResult(Activity.java:3331) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.Activity.startActivity(Activity.java:3566) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.Activity.startActivity(Activity.java:3534) 
01-03 16:20:38.102: E/AndroidRuntime(953): at com.january.floogoo.ContactTab.onOptionsItemSelected(ContactTab.java:90) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.Activity.onMenuItemSelected(Activity.java:2548) 
01-03 16:20:38.102: E/AndroidRuntime(953): at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:980) 
01-03 16:20:38.102: E/AndroidRuntime(953): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735) 
01-03 16:20:38.102: E/AndroidRuntime(953): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149) 
01-03 16:20:38.102: E/AndroidRuntime(953): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874) 
01-03 16:20:38.102: E/AndroidRuntime(953): at com.android.internal.view.menu.ListMenuPresenter.onItemClick(ListMenuPresenter.java:166) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.widget.AdapterView.performItemClick(AdapterView.java:298) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.widget.AbsListView.performItemClick(AbsListView.java:1100) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2749) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.widget.AbsListView$1.run(AbsListView.java:3423) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.os.Handler.handleCallback(Handler.java:725) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.os.Handler.dispatchMessage(Handler.java:92) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.os.Looper.loop(Looper.java:137) 
01-03 16:20:38.102: E/AndroidRuntime(953): at android.app.ActivityThread.main(ActivityThread.java:5039) 
01-03 16:20:38.102: E/AndroidRuntime(953): at java.lang.reflect.Method.invokeNative(Native Method) 
01-03 16:20:38.102: E/AndroidRuntime(953): at java.lang.reflect.Method.invoke(Method.java:511) 
01-03 16:20:38.102: E/AndroidRuntime(953): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
01-03 16:20:38.102: E/AndroidRuntime(953): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 
01-03 16:20:38.102: E/AndroidRuntime(953): at dalvik.system.NativeStart.main(Native Method) 

的Manifest.xml

<activity 
     android:name="com.january.floogoo.Main" 
     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=".ContactTab"></activity> 
    <activity android:name=".MonthTab"></activity> 
    <activity android:name=".WeekTab"></activity> 
    <activity android:name=".PersonalGreeting"></activity> 
    <activity android:name=".GlobalGreeting"></activity> 
    <activity android:name=".AlertPage"></activity> 
    <activity android:name=".Settings"></activity> 
    <activity android:name=".Alert2"></activity> 
+0

您的活動是不是在你的清單(順便說一句,這是錯誤說的) – njzk2

+0

你要發佈com.january.floogoo.ContactTab.onOptionsItemSelected(ContactTab.java:90) – njzk2

+0

的內容在這裏添加整個清單文件不僅僅是活動標籤 – TNR

回答

0

聲明設置活動作爲清單:

<activity android:name="com.january.floogoo.Settings" /> 

,並使用完整的包名開始設置的活動,因爲您已經導入另一個包與同一活動名稱

Intent intentd=new Intent(Current_Activity.this, 
           com.january.floogoo.Settings.class); 
startActivity(intentd); 
+0

的代碼。正如堆棧跟蹤所示,包名是com.january.floogoo – njzk2

+0

@ njzk2:同樣來自stacktrace的'com.january.floogoo/android.media.audiofx.BassBoost $ Settings' –

+0

@ njzk2:right是'com.january.floogoo/com.january.floogoo $設置' –

0

您已經有了您的清單Setting活動,但我認爲有錯誤的組件名稱。 嘗試使用完整軟件包名稱(如com.january.floogoo.Settings)進行設置。

相關問題