Hello,
Google Play user send me an error in my app:
java.lang.IllegalArgumentException
emplacement : android.graphics.Bitmap.nativeCreate
It's not so easy to know what line of my program must be change cause it's give line number in java
the code of offset
Google Play user send me an error in my app:
java.lang.IllegalArgumentException
emplacement : android.graphics.Bitmap.nativeCreate
java.lang.RuntimeException: java.lang.IllegalArgumentException: width and height must be > 0
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:149)
at anywheresoftware.b4a.objects.WallpaperInternalService$LWManager.raiseEvent(WallpaperInternalService.java:99)
at anywheresoftware.b4a.objects.WallpaperInternalService$B4AEngine.onOffsetsChanged(WallpaperInternalService.java:274)
at android.service.wallpaper.WallpaperService$Engine.doOffsetsChanged(WallpaperService.java:717)
at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:905)
at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.InitializeMutable(CanvasWrapper.java:543)
at mangawallpaper.yukie.wallpaperservice._vvvvvvvvvvvvvvvv2(wallpaperservice.java:190)
at mangawallpaper.yukie.wallpaperservice._lwm_offsetchanged(wallpaperservice.java:113)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:165)
... 14 more
It's not so easy to know what line of my program must be change cause it's give line number in java
the code of offset
B4X:
Sub LWM_OffsetChanged (Engine As LWEngine)
If image.IsInitialized AND resized.IsInitialized = False Then
resized = ResizeImage(image, Engine.FullWallpaperWidth, Engine.FullWallpaperHeight)
End If
If resized.IsInitialized Then
' Engine.Rect.Left = -Engine.CurrentOffsetX
' Engine.Rect.Top = -Engine.CurrentOffsetY
' Engine.Rect.Right = -Engine.CurrentOffsetX + Engine.FullWallpaperWidth
' Engine.Rect.Bottom = -Engine.CurrentOffsetY + Engine.FullWallpaperHeight
Engine.Rect.Left = -(Engine.FullWallpaperWidth - actualImageWidth) / 2
Engine.Rect.Top = 0
Engine.Rect.Right = Engine.Rect.Left + Engine.FullWallpaperWidth
Engine.Rect.Bottom = Engine.FullWallpaperHeight
Engine.Canvas.DrawBitmap(resized, Null, Engine.Rect)
End If
Engine.RefreshAll
End Sub
Last edited: