Android Question Add XUI CustomView to a Panel Dynamically

Status
Not open for further replies.

mkh_fx

Member
Licensed User
i use below code to create CircularProgressBar in a panel dynamically

CircularProgressBar is a XUI Library

when run below code displayed a error
B4X:
Dim progress As CircularProgressBar
progress.Initialize(Me,"progress")
Panel1.AddView(progress,100dip,0,100dip,100dip)



error:
B4X:
**
java.lang.IllegalArgumentException: method anywheresoftware.b4a.objects.PanelWrapper.AddView argument 1 has type android.view.View, got org.rahbord.shahrcharity.circularprogressbar
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:783)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:363)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
    at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:259)
    at org.rahbord.shahrcharity.projects._showprojects(projects.java:497)
    at org.rahbord.shahrcharity.projects._loadlayout(projects.java:432)
    at org.rahbord.shahrcharity.projects._activity_create(projects.java:364)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:738)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at org.rahbord.shahrcharity.projects.afterFirstLayout(projects.java:104)
    at org.rahbord.shahrcharity.projects.access$000(projects.java:17)
    at org.rahbord.shahrcharity.projects$WaitForLayout.run(projects.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5221)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
 

DonManfred

Expert
Licensed User
CircularProgressBar
CircularProgressBar is not a view which you can add to a panel.

Use the designer, add the CircularProgressBar to a layout and load this layout to the panel.
 
Upvote 0

mkh_fx

Member
Licensed User
thank you my friend

i create dynamic panel and loadlayout from my code
but i need change each CircularProgressBar value from my code

how to access each CircularProgressBar Which is dynamically created
 
Upvote 0

jtare

Active Member
Licensed User
The object (if you generated the member from the designer) is available after you loaded the layout.
How can I edit the value of it?
I added the CircularProgressBar to a customlistview, but when I want to edit the value how can I target only the CircularProgressBar that I want?
Since is not a view, I can't get it from the panel.
 
Upvote 0
Status
Not open for further replies.
Top