Android Question NullPointerException in zoomimageview

angel_

Well-Known Member
Licensed User
Longtime User
I have this error in Firebase that occurs (rarely) when starting the application:

page_app.Initialize
B4XPages.AddPageAndCreate("app_page", app_page)

Any idea why?

B4X:
Fatal Exception: java.lang.NullPointerException

Attempt to read from null array
com.my_app.zoomimageview._touchlistener_event (zoomimageview.java:370)
java.lang.reflect.Method.invokeNative (Method.java)

anywheresoftware.b4j.object.JavaObject.RunMethod (JavaObject.java:132)
com.my_app.zoomimageview._designercreateview (zoomimageview.java:163)
java.lang.reflect.Method.invokeNative (Method.java)

anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout (B4XViewWrapper.java:329)
com.my_app.page_app._my_layout (page_app.java:60)
com.my_app.page_app._b4xpage_created (page_app.java:146)
com.my_app.page_app.callSub (page_app.java:437)
 

William Lancee

Well-Known Member
Licensed User
Longtime User
Is it possible that the initialization of app_page is not finished?
If so, add a Wait for App_Page_Ready.

And put CallSubDelayed(B4XPages.MainPage, "App_Page_Ready") at end of Initialize of the page.
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
Thank you for the response, it happens when Initialize or AddPageAndCreate the page during the startup of the app, I really can't get to that page, I don't have more information since I can't reproduce the error.
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
I appreciate that the code will be too large to post, and/or you can't share it.
Could you just post the initialize sub and B4Xpage_created sub?
Or PM those two subs (zipped if too large). I'll look at it. Perhaps fresh eyes will notice something.
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
I'm testing to see if I can reproduce the error since it doesn't always appear.
 
Upvote 0
Top