没有找到Android活动异常没有意义

时间:2010-08-28 05:13:10

标签: android android-manifest

好吧,我正在尝试制作一个Live Wallapper,但每当我点击设置时它就会强行关闭。说找不到没有任何意义的活动,因为我在Manifest中有它。这真的开始让我感到烦恼,因为我已经超过2个小时了。

logcat的:08-28 01:06:49.903: INFO/ActivityManager(1089): Starting activity: Intent { cmp=quotesandothers.livewallpaper.quotesandothers/quotesandothers.livewallpaper.quotesandothers (has extras) } 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): FATAL EXCEPTION: main 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): java.lang.IllegalStateException: Could not execute method of the activity 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.view.View$1.onClick(View.java:2072) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.view.View.performClick(View.java:2408) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.view.View$PerformClick.run(View.java:8816) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.os.Handler.handleCallback(Handler.java:587) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.os.Handler.dispatchMessage(Handler.java:92) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.os.Looper.loop(Looper.java:123) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.app.ActivityThread.main(ActivityThread.java:4627) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at java.lang.reflect.Method.invokeNative(Native Method) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at java.lang.reflect.Method.invoke(Method.java:521) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at dalvik.system.NativeStart.main(Native Method) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): Caused by: java.lang.reflect.InvocationTargetException 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at com.android.wallpaper.livepicker.LiveWallpaperPreview.configureLiveWallpaper(LiveWallpaperPreview.java:113) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at java.lang.reflect.Method.invokeNative(Native Method) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at java.lang.reflect.Method.invoke(Method.java:521) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.view.View$1.onClick(View.java:2067) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): ... 11 more 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {quotesandothers.livewallpaper.quotesandothers/quotesandothers.livewallpaper.quotesandothers}; have you declared this activity in your AndroidManifest.xml? 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.app.Activity.startActivityForResult(Activity.java:2817) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): at android.app.Activity.startActivity(Activity.java:2923) 08-28 01:06:49.934: ERROR/AndroidRuntime(15221): ... 15 more

清单:`                                                                            

    </application>

<uses-sdk android:minSdkVersion="7" />
<uses-feature android:name="android.software.live_wallpaper" />

`

1 个答案:

答案 0 :(得分:0)

您的代码启动活动。您必须在AndroidManifest.xml中提及此活动。

像:

<activity android:name="your.package.name.ActivityClassName">
</activity>

以下是感兴趣的部分:

ERROR/AndroidRuntime(15221): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {quotesandothers.livewallpaper.quotesandothers/quotesandothers.livewallpaper.quotesandothers}; have you declared this activity in your AndroidManifest.xml? 08-28 
相关问题