Android Question SqliteEXTRA Lib .ReadBitmap error

mike1967

Active Member
Licensed User
Longtime User
Hello I Have this error on usig this library :
planimetria_b4xpage_appear (java line: 118)
java.lang.NullPointerException: Attempt to get length of null array
at b4a.example.sqlite._v0(sqlite.java:106)
at b4a.example.sqlite._vvv5(sqlite.java:536)
at com.app.regant.planimetria._b4xpage_appear(planimetria.java:118)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1178)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

with this code:
B4X:
Dim rant As sqlite
    rant.Initialize
    Dim pathdb As String
    pathdb=DBUtils.CopyDBFromAssets("rant.sqlite")
    Log(pathdb & "/rant.sqlite")
    Dim bmp As Bitmap
    bmp= rant.readBitmap(pathdb & "/rant.sqlite","impianti","id=" & Main.recno,"planimetria")
    imgViewPlanimetria.SetBitmap(bmp)

I think regards thath the blob field is empty, How to avoid This ? Thanks in advance
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You don't need to use a library for this. Use SQL, read the blob and convert it to an image.
 
Upvote 0
Top