I also experiencing this problem on my Nexus S 4g, but I am running 2.3.7.
I am trying to write a simple live wallpaper, but it seems that this crash
is happening when the preview live wallpaper gets cleaned up (I could
totally be wrong, but that's what it seems like).
Interestingly the live wallpaper does actually work and assigns my
wallpaper as you would expect. In my case the exception is being thrown for
some reason after using the WallpaperManager class.
Please no comments about how wrong this code is... I am trying to reduce
this down to the barest reproducible code bits, and I have also just
started trying to make a live wallpaper an hour ago when I got hit with
this issue.
If you want to duplicate the behavior, just point the relevant path to an
image on your sdcard.
W/InputQueue-JNI(16794): Input channel is not initialized.
W/WindowManager(14622): Attempted to add wallpaper window with unknown
token android.os.Binder@40a1fe70. Aborting.
D/AndroidRuntime(16794): Shutting down VM
W/dalvikvm(16794): threadid=1: thread exiting with uncaught exception
(group=0x40015560)
E/AndroidRuntime(16794): FATAL EXCEPTION: main
E/AndroidRuntime(16794): java.lang.RuntimeException: Failed to register
input channel. Check logs for details.
E/AndroidRuntime(16794): at
android.view.InputQueue.nativeRegisterInputChannel(Native Method)
E/AndroidRuntime(16794): at
android.view.InputQueue.registerInputChannel(InputQueue.java:92)
E/AndroidRuntime(16794): at
android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:521)
E/AndroidRuntime(16794): at
android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:651)
E/AndroidRuntime(16794): at
android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:875)
E/AndroidRuntime(16794): at
com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)
E/AndroidRuntime(16794): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(16794): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(16794): at
android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime(16794): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(16794): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(16794): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(16794): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime(16794): at dalvik.system.NativeStart.main(Native Method)
The WallpaperService:
*package* com.bubbletastic.wallpapercycler;
*import* java.io.IOException;
*import* android.app.WallpaperManager;
*import* android.graphics.Bitmap;
*import* android.graphics.BitmapFactory;
*import* android.os.Environment;
*import* android.os.Handler;
*import* android.service.wallpaper.WallpaperService;
*import* android.util.Log;
*public* *class* WallpaperCycler *extends* WallpaperService {
Handler handler = *new* Handler();
@Override
*public* Engine onCreateEngine() {
*return* *new* WallpaperCyclerEngine();
}
*private* *class* WallpaperCyclerEngine *extends* Engine {
*public* WallpaperCyclerEngine() {
*super*();
*try* {
String path = Environment.*getExternalStorageDirectory*()+
/Wallpapers/1_black-wood.png;
Bitmap wallpaper = BitmapFactory.*decodeFile*(path);
*if* (wallpaper != *null*) {
WallpaperManager.*getInstance*(WallpaperCycler.*this*
).setBitmap(wallpaper);
} *else* {
Log.*d*(WallpaperCycler, bitmap was null, tried to decode path:
+path);
}
} *catch* (IOException e) {
// *TODO* Auto-generated catch block
e.printStackTrace();
}
}
}
}
And the manifest of the app:
?xml version=*1.0* encoding=*utf-8*?
manifest xmlns:android=*http://schemas.android.com/apk/res/android*
package=*com.bubbletastic.wallpapercycler*
android:versionCode=*1*
android:versionName=*1.0*
uses-sdk android:minSdkVersion=*7* /
uses-permission android:name=*android.permission.SET_WALLPAPER* /
uses-permission android:name=*
android.permission.WRITE_EXTERNAL_STORAGE* /
uses-feature android:name=*android.software.live_wallpaper* /
application
service
android:name=*.WallpaperCycler*
android:permission=*android.permission.BIND_WALLPAPER*
intent-filter
action android:name=*
android.service.wallpaper.WallpaperService* /
/intent-filter
meta-data
android:name=*android.service.wallpaper*
android:resource=*@xml/xmlnsref* /
/service
/application
/manifest
And the meta-data resource:
?xml version=*1.0* encoding=*utf-8*?
wallpaper xmlns:android=*http://schemas.android.com/apk/res/android*
/
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To