We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Can anyone help me to find out where is the problem? I programmed a liveWallpaper, and I rotated the screen on the "set wallpaper" interface (this is a tablet with a big screen size). And the live wallpaper restarted, and sometimes the app crashed(not always) with a nullPointerException. The LiveWallpaper kept running on the background.
E/AndroidRuntime: FATAL EXCEPTION: Animation Thread
Process: tianranwang.livewallpaper, PID: 8381
java.lang.NullPointerException: Attempt to invoke interface method 'void android.view.SurfaceHolder.unlockCanvasAndPost(android.graphics.Canvas)' on a null object reference
at processing.a2d.PGraphicsAndroid2D.endDraw(Unknown Source)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PSurfaceNone.callDraw(Unknown Source)
at processing.core.PSurfaceNone$AnimationThread.run(Unknown Source)
Answers
@TrW236=== have you choosen an orientation for your livewallpaper?
if no you have to manage by yourself configChanges().