0

好吧,我正在尝试制作一个 Live Wallapper,但每当我点击设置时,它都会强制关闭。说未找到该活动没有任何意义,因为我在清单中有它。这真的开始困扰我,因为我已经做了两个多小时了。

日志猫: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" />

`

4

1 回答 1

0

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

喜欢:

<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 
于 2011-07-22T12:03:32.647 回答