2 つのクラスでライブ壁紙プロジェクトを実行しようとしています: 1. LiveWallpaper 2. LiveWallpaperSettings マニフェストに両方の名前を追加しましたが、ここでこのクラスキャスト例外が発生する理由がわかりません。マニフェスト コードも追加しています。
12-13 22:41:48.861: W/dalvikvm(3599): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
12-13 22:41:48.871: E/AndroidRuntime(3599): FATAL EXCEPTION: main
12-13 22:41:48.871: E/AndroidRuntime(3599): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ca.jvsh.livewallpaper/ca.jvsh.livewallpaper.LiveWallpaper}: java.lang.ClassCastException: ca.jvsh.livewallpaper.LiveWallpaper cannot be cast to android.app.Activity
12-13 22:41:48.871: E/AndroidRuntime(3599): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1879)
12-13 22:41:48.871: E/AndroidRuntime(3599): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
12-13 22:41:48.871: E/AndroidRuntime(3599): at android.app.ActivityThread.access$600(ActivityThread.java:122)
12-13 22:41:48.871: E/AndroidRuntime(3599): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
12-13 22:41:48.871: E/AndroidRuntime(3599): at android.os.Handler.dispatchMessage(Handler.java:99)
12-13 22:41:48.871: E/AndroidRuntime(3599): at android.os.Looper.loop(Looper.java:137)
12-13 22:41:48.871: E/AndroidRuntime(3599): at android.app.ActivityThread.main(ActivityThread.java:4340)
12-13 22:41:48.871: E/AndroidRuntime(3599): at java.lang.reflect.Method.invokeNative(Native Method)
12-13 22:41:48.871: E/AndroidRuntime(3599): at java.lang.reflect.Method.invoke(Method.java:511)
12-13 22:41:48.871: E/AndroidRuntime(3599): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-13 22:41:48.871: E/AndroidRuntime(3599): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-13 22:41:48.871: E/AndroidRuntime(3599): at dalvik.system.NativeStart.main(Native Method)
12-13 22:41:48.871: E/AndroidRuntime(3599): Caused by: java.lang.ClassCastException: ca.jvsh.livewallpaper.LiveWallpaper cannot be cast to android.app.Activity
12-13 22:41:48.871: E/AndroidRuntime(3599): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
12-13 22:41:48.871: E/AndroidRuntime(3599): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1870)
12-13 22:41:48.871: E/AndroidRuntime(3599): ... 11 more
12-13 22:41:51.891: I/Process(3599): Sending signal. PID: 3599 SIG: 9
*マニフェスト コード*
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ca.jvsh.livewallpaper"
android:versionCode="1"
android:versionName="1.0.20100908.1" >
<uses-sdk android:minSdkVersion="7" />
<uses-feature android:name="android.software.live_wallpaper" />
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:permission="android.permission.BIND_WALLPAPER" >
<service
android:name=".LiveWallpaper"
android:icon="@drawable/icon"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="@layout/livewallpaper" />
</service>
<activity
android:name=".LiveWallpaperSettings"
android:exported="true"
android:icon="@drawable/icon"
android:label="@string/livewallpaper_settings"
android:theme="@android:style/Theme.Light.WallpaperSettings" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>