Hi All,
I found something that drove me mad for a day or so...
In my code, I am using the Animation library 1.02. I couldn't see an effect I was hoping to see on the Samsung Galaxy Tab 2 10 (Android 4.0.4)
I thought this might be caused by a runaway process...so I put a 'DoEvents' in my code, assuming that it if there were no messages it would effectively be ignored.
I happened to try the code on my Nexus 7 (Android 4.1.1) where it worked fine...but the program would seemingly halt on the Samsung.
Turns out it was an interesting exception (pasted at the bottom).
In looking at the generated java file com.flippinbits.milestones.main, line 3490, I see "DoEvents".
Is this a bug, or did I use DoEvents wrong?
-Ken
----------------------------------
E/SurfaceTextureClient(15563): Surface::lock failed, already locked
E/ViewRootImpl(15563): IllegalArgumentException locking surface
E/ViewRootImpl(15563): java.lang.IllegalArgumentException
E/ViewRootImpl(15563): at android.view.Surface.lockCanvasNative(Native Method)
E/ViewRootImpl(15563): at android.view.Surface.lockCanvas(Surface.java:76)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2004)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1693)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2505)
E/ViewRootImpl(15563): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRootImpl(15563): at anywheresoftware.b4a.Msgbox.waitForMessage(Msgbox.java:211)
E/ViewRootImpl(15563): at anywheresoftware.b4a.Msgbox.waitForMessage(Msgbox.java:180)
E/ViewRootImpl(15563): at anywheresoftware.b4a.keywords.Common.DoEvents(Common.java:367)
E/ViewRootImpl(15563): at com.flippinbits.milestones.main._setcard(main.java:3490)
E/ViewRootImpl(15563): at com.flippinbits.milestones.main._setgo_animationend(main.java:3528)
E/ViewRootImpl(15563): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRootImpl(15563): at java.lang.reflect.Method.invoke(Method.java:511)
E/ViewRootImpl(15563): at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
E/ViewRootImpl(15563): at anywheresoftware.b4a.BA.raiseEvent2(BA.java:158)
E/ViewRootImpl(15563): at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
E/ViewRootImpl(15563): at anywheresoftware.b4a.objects.AnimationWrapper$1.onAnimationEnd(AnimationWrapper.java:104)
E/ViewRootImpl(15563): at android.view.animation.Animation.getTransformation(Animation.java:843)
E/ViewRootImpl(15563): at android.view.animation.Animation.getTransformation(Animation.java:887)
E/ViewRootImpl(15563): at android.view.ViewGroup.drawChild(ViewGroup.java:2668)
E/ViewRootImpl(15563): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2500)
E/ViewRootImpl(15563): at android.view.View.draw(View.java:11033)
E/ViewRootImpl(15563): at android.view.ViewGroup.drawChild(ViewGroup.java:2898)
E/ViewRootImpl(15563): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2500)
E/ViewRootImpl(15563): at android.view.ViewGroup.drawChild(ViewGroup.java:2896)
E/ViewRootImpl(15563): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2500)
E/ViewRootImpl(15563): at android.view.ViewGroup.drawChild(ViewGroup.java:2896)
E/ViewRootImpl(15563): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2500)
E/ViewRootImpl(15563): at android.view.View.draw(View.java:11033)
E/ViewRootImpl(15563): at android.widget.FrameLayout.draw(FrameLayout.java:450)
E/ViewRootImpl(15563): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2274)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2087)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1693)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2505)
E/ViewRootImpl(15563): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRootImpl(15563): at android.os.Looper.loop(Looper.java:137)
E/ViewRootImpl(15563): at android.app.ActivityThread.main(ActivityThread.java:4514)
E/ViewRootImpl(15563): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRootImpl(15563): at java.lang.reflect.Method.invoke(Method.java:511)
E/ViewRootImpl(15563): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
E/ViewRootImpl(15563): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
E/ViewRootImpl(15563): at dalvik.system.NativeStart.main(Native Method)
I found something that drove me mad for a day or so...
In my code, I am using the Animation library 1.02. I couldn't see an effect I was hoping to see on the Samsung Galaxy Tab 2 10 (Android 4.0.4)
I thought this might be caused by a runaway process...so I put a 'DoEvents' in my code, assuming that it if there were no messages it would effectively be ignored.
I happened to try the code on my Nexus 7 (Android 4.1.1) where it worked fine...but the program would seemingly halt on the Samsung.
Turns out it was an interesting exception (pasted at the bottom).
In looking at the generated java file com.flippinbits.milestones.main, line 3490, I see "DoEvents".
Is this a bug, or did I use DoEvents wrong?
-Ken
----------------------------------
E/SurfaceTextureClient(15563): Surface::lock failed, already locked
E/ViewRootImpl(15563): IllegalArgumentException locking surface
E/ViewRootImpl(15563): java.lang.IllegalArgumentException
E/ViewRootImpl(15563): at android.view.Surface.lockCanvasNative(Native Method)
E/ViewRootImpl(15563): at android.view.Surface.lockCanvas(Surface.java:76)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2004)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1693)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2505)
E/ViewRootImpl(15563): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRootImpl(15563): at anywheresoftware.b4a.Msgbox.waitForMessage(Msgbox.java:211)
E/ViewRootImpl(15563): at anywheresoftware.b4a.Msgbox.waitForMessage(Msgbox.java:180)
E/ViewRootImpl(15563): at anywheresoftware.b4a.keywords.Common.DoEvents(Common.java:367)
E/ViewRootImpl(15563): at com.flippinbits.milestones.main._setcard(main.java:3490)
E/ViewRootImpl(15563): at com.flippinbits.milestones.main._setgo_animationend(main.java:3528)
E/ViewRootImpl(15563): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRootImpl(15563): at java.lang.reflect.Method.invoke(Method.java:511)
E/ViewRootImpl(15563): at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
E/ViewRootImpl(15563): at anywheresoftware.b4a.BA.raiseEvent2(BA.java:158)
E/ViewRootImpl(15563): at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
E/ViewRootImpl(15563): at anywheresoftware.b4a.objects.AnimationWrapper$1.onAnimationEnd(AnimationWrapper.java:104)
E/ViewRootImpl(15563): at android.view.animation.Animation.getTransformation(Animation.java:843)
E/ViewRootImpl(15563): at android.view.animation.Animation.getTransformation(Animation.java:887)
E/ViewRootImpl(15563): at android.view.ViewGroup.drawChild(ViewGroup.java:2668)
E/ViewRootImpl(15563): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2500)
E/ViewRootImpl(15563): at android.view.View.draw(View.java:11033)
E/ViewRootImpl(15563): at android.view.ViewGroup.drawChild(ViewGroup.java:2898)
E/ViewRootImpl(15563): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2500)
E/ViewRootImpl(15563): at android.view.ViewGroup.drawChild(ViewGroup.java:2896)
E/ViewRootImpl(15563): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2500)
E/ViewRootImpl(15563): at android.view.ViewGroup.drawChild(ViewGroup.java:2896)
E/ViewRootImpl(15563): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2500)
E/ViewRootImpl(15563): at android.view.View.draw(View.java:11033)
E/ViewRootImpl(15563): at android.widget.FrameLayout.draw(FrameLayout.java:450)
E/ViewRootImpl(15563): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2274)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2087)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1693)
E/ViewRootImpl(15563): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2505)
E/ViewRootImpl(15563): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRootImpl(15563): at android.os.Looper.loop(Looper.java:137)
E/ViewRootImpl(15563): at android.app.ActivityThread.main(ActivityThread.java:4514)
E/ViewRootImpl(15563): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRootImpl(15563): at java.lang.reflect.Method.invoke(Method.java:511)
E/ViewRootImpl(15563): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
E/ViewRootImpl(15563): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
E/ViewRootImpl(15563): at dalvik.system.NativeStart.main(Native Method)