Hi all,
I have this error:
The code is:
Error is on addview statement.
Note that I use RemoveView....
Why happens it?
Thanks
Marco
I have this error:
B4X:
risposta : OK
dettaglioatleta$ResumableSub_RiempiItemresume (java line: 963)
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:3770)
at android.view.ViewGroup.addView(ViewGroup.java:3623)
at android.view.ViewGroup.addView(ViewGroup.java:3599)
at anywheresoftware.b4a.objects.PanelWrapper.AddView(PanelWrapper.java:65)
at com.mamavi.webfitness.dettaglioatleta$ResumableSub_RiempiItem.resume(dettaglioatleta.java:963)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:240)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1151)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
The code is:
B4X:
Fotolo.Initialize("")
Fotolo.RemoveView
fotostruttura.Initialize(File.DirAssets,"webfitnesstrasp.png")
Fotologo.Initialize(File.DirDefaultExternal,"logoasso.jpg")
Fotolo.Bitmap=fotostruttura
If Main.WFStrutturalogo<>"" Then
Dim j As HttpJob
j.Initialize("", Me)
j.Download(Main.WFStrutturalogo)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim FotoBit As Bitmap = j.GetBitmap
End If
j.Release
Fotolo.Bitmap = FotoBit
End If
wfNorizie.Panel.AddView(Fotolo, 20%x,wtop,60%x,30%x)
Fotolo.Gravity=Gravity.FILL
Note that I use RemoveView....
Why happens it?
Thanks
Marco