Bug? What is it that needs to be initialized?

Lee Gillie CCP

Active Member
Licensed User
Longtime User
Help!

The routine I am debugging:
Public Sub AddToParent(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)
    Log($"SearchView2.AddToParent: clv.IsInitialized=${clv.IsInitialized}"$)
    mParent = Parent

    Log($"Parent.IsInitialized = ${Parent.IsInitialized}"$)
    Log($"holder.IsInitialized = ${holder.IsInitialized}"$)
    Log($"et.IsInitialized = ${et.IsInitialized}"$)
    Log($"clv.IsInitialized = ${clv.IsInitialized}"$)
    Log($"clv.AsView.IsInitialized = ${clv.AsView.IsInitialized}"$)
    Log("There is no way to initialize clv.AsView")
    ' Create a host panel first; only then add inner views.
    mParent.AddView(holder, Left, Top, Width, Height)
    holder.Color = Colors.Transparent

    holder.AddView(et, 0, 0, Width, 60dip)
    ' The following crashes:
    holder.AddView(clv.AsView, 0, et.Height, Width, Height - et.Height)

    clv.AsView.Visible = False   ' safe now (already parented)
End Sub

What this logs:



It makes no sense to me!

TIA for any ideas - Best regards, Lee Gillie, CCP
 

Lee Gillie CCP

Active Member
Licensed User
Longtime User
you don't need the .asView suffix, just use clv

Cableguy - Thank you for responding

I tried just passing clv, but now it does this...
 

Cableguy

Expert
Licensed User
Longtime User
remove any ".asView" you have on your code, you don't need that and it doesn't work!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…