LoadBitmapSample error

basil99

Active Member
Licensed User
Longtime User
Hi!

Got a weird error on LoadBitmapSample:


java.lang.NullPointerException at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.InitializeSample(CanvasWrapper.java:557)
at anywheresoftware.b4a.keywords.Common.LoadBitmapSample(Common.java:1085)
at apptest10.main._setpicture(main.java:4396)
at apptest10.main._createpics(main.java:1812)
at apptest10.main._createviewstack(main.java:2511)
at apptest10.main._activity_resume(main.java:647)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at apptest10.main.afterFirstLayout(main.java:95)
at apptest10.main.access$100(main.java:16)
at apptest10.main$WaitForLayout.run(main.java:74)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
at dalvik.system.NativeStart.main(Native Method)


error was cause by this line of code ( Jobdone sub from HttpUtils2 ):

B4X:
someimageview.Bitmap = LoadBitmapSample( SaveLoadPath, S, MinDim, MinDim )


Where MinDim, according to logs is 590 pixels, S is jpg filename, but without extension, like "4" or "58" or whatever ( just a HttpJob names ). Someimageview according to logs is initialised. SaveloadPath is File.DirInternalCache.


App works perfect on device with OS 2.2, but i got this error on Sony Xperia with Android 4.0.4.

Error appears from time to time, not at the same point. Error fires after orientaion change. On this step I initialise all views, check if picture file is loaded and then load bitmapsample



Thanks in advance for help
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…