Android Question create Anotherprogressbar with code

Dieter Baumgartner

Member
Licensed User
Longtime User
Hello,
i try to create Anotherprogressbar inside a BBCodeview.

B4X:
Dim pb As AnotherProgressBar
pb.Initialize(Root,"sw")
pb.mBase.SetLayoutAnimated(0,0,0,500dip,30dip)

I always get java.lang.RuntimeException: Object should first be initialized (B4XView) in Line 3. What is wrong with pb.initialize ? It is a B4Xpage, so i call ROOT as Callback.
Has anyone createt Anotherprogressbar by code ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0

Dieter Baumgartner

Member
Licensed User
Longtime User
Thank you Erel, i didn't know that
Custom views are designed to be added with the designer. ]
So i get a problem when i make
B4X:
Root.LoadLayout("ProgressBar") 'load a layout with one Element of type Anotherprogressbar
BBCodeView1.Views.Put("pb", pb) 'put to a BBcodeview
because it puts the Progressbar already on top visible and not only in the BBcodeview Listitem.
1609780840667.png


I also wanted to achieve clicking a Checkbox and then changing the Value of the AnotherProgressbar inside the same Listitem of BBcodeview.
It seems that this is not possible with BBcodeview, i cannot touch this element directly.
I would have to store the value and redraw the whole BBcodeview, right ?
 
Upvote 0
Top