i have trouble, have a page with 3 imgx(B4xImageView added in designer) , 'x' wich mean 1,2,3.
in page1 i have this piece of code that open next page (pageCargaEvidencia)
the page pageCargaEvidencia load correctly, here is img1,img2,img3 added in designer.
that page(pageCargaEvidencia) take a picture and put in img1, img2,img3 recursively.
I have 3 boolean to determine if img1 has been load a bmp, and img2 and img3, all correctly taken pictures 1, 2 and 3 without close the page..
imagine that i take only 1 picture.., img1 is loaded, img2 empty and img3 empty.
the problem is when i go back, with back key or B4xPages.ClosePage(me) and then..
click on cmdSiguiente_Click to show pageCargaEvidencia again, the B4XImageview (img1,img2,im3) is
still showing the picture that i take (in this case img1 is loaded, and img2 and img3 still empty)...
The trouble start Here if i take the picture again to load in the next B4XImageView (img2 in this case) , this occur:
-The boolean that i control the taked picture,, is reset to false, and the code try to load img1, not img2.
-The img1 try to load the picture taked, give me a error, B4XPages Class instance was not initialized (b4ximageview).
The code after take a picture with success true, i call PoneFoto(picdatafromcamera)
Log
this error ocurr when go back a page, load again the closed page to take picture and the code execute again the line:
-why is not initialized?, because is added with designer and not need to be initialize.
-when i control the initialize to try solution of img1 with XUIViewsUtils.CreateB4XImageView, then the img1 is go empty.
the idea is when i close a page contains img1,img2 and img3, hold the data when i open it again, but
when i assign a data again to image (img1, or a empty img2..) give me the error that no initialized b4ximageview that assumed is initialized..
Why This?
in page1 i have this piece of code that open next page (pageCargaEvidencia)
B4X:
Private Sub cmdSiguiente_Click
Try
pageCargaEvidencia.Initialize
B4XPages.ShowPage("pageCargaEvidencia")
Catch
Log(LastException)
pageCargaEvidencia.Initialize
B4XPages.AddPageAndCreate("pageCargaEvidencia",pageCargaEvidencia)
B4XPages.ShowPage("pageCargaEvidencia")
End Try
End Sub
the page pageCargaEvidencia load correctly, here is img1,img2,img3 added in designer.
that page(pageCargaEvidencia) take a picture and put in img1, img2,img3 recursively.
I have 3 boolean to determine if img1 has been load a bmp, and img2 and img3, all correctly taken pictures 1, 2 and 3 without close the page..
imagine that i take only 1 picture.., img1 is loaded, img2 empty and img3 empty.
the problem is when i go back, with back key or B4xPages.ClosePage(me) and then..
click on cmdSiguiente_Click to show pageCargaEvidencia again, the B4XImageview (img1,img2,im3) is
still showing the picture that i take (in this case img1 is loaded, and img2 and img3 still empty)...
The trouble start Here if i take the picture again to load in the next B4XImageView (img2 in this case) , this occur:
-The boolean that i control the taked picture,, is reset to false, and the code try to load img1, not img2.
-The img1 try to load the picture taked, give me a error, B4XPages Class instance was not initialized (b4ximageview).
The code after take a picture with success true, i call PoneFoto(picdatafromcamera)
B4X:
Public Sub PoneFoto (bmp As B4XBitmap)
If Tiene1=False Then
img1.ResizeMode="FILL"
img1.Bitmap=bmp
Tiene1=True
Return
End If
If Tiene2=False Then
img2.ResizeMode="FILL"
img2.Bitmap=bmp
Tiene2=True
Return
End If
If Tiene3=False Then
img3.ResizeMode="FILL"
img3.Bitmap=bmp
Tiene3=True
Return
End If
End Sub
Log
B4X:
** Activity (main) Resume **
Error occurred on line: 71 (B4XImageView)
java.lang.RuntimeException: Class instance was not initialized (b4ximageview)
at anywheresoftware.b4a.debug.Debug.shouldDelegate(Debug.java:242)
at b4a.example.b4ximageview._setresizemode(b4ximageview.java:74)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at b4a.example.p_cargaevidencia._ponefoto(p_cargaevidencia.java:352)
at b4a.example.p_cargaevidencia$ResumableSub_TomaFoto.resume(p_cargaevidencia.java:333)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6228)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
B4X:
img1.ResizeMode="FILL"
-why is not initialized?, because is added with designer and not need to be initialize.
-when i control the initialize to try solution of img1 with XUIViewsUtils.CreateB4XImageView, then the img1 is go empty.
the idea is when i close a page contains img1,img2 and img3, hold the data when i open it again, but
when i assign a data again to image (img1, or a empty img2..) give me the error that no initialized b4ximageview that assumed is initialized..
Why This?