Android Question AnotherDatePicker Add

Derek Jee

Active Member
Licensed User
Longtime User
Hi all

Can anyone tell me how to add the ADP in code as I can't seem to find any examples. The intro page says it is better to do it in the designer but I have already designed it in code.


Thank you :)

Derek.
 

pesquera

Active Member
Licensed User
Longtime User
B4X:
adp3.AddToActivity(Activity, label1) 'label1 is an existing label
Hi, I also need to implement this class without the designer.. but, I had not the "AddToActivity" method
What am I missing?
 

Attachments

  • ADP.png
    ADP.png
    7.2 KB · Views: 169
Upvote 0

pesquera

Active Member
Licensed User
Longtime User
[
Try
B4X:
Activity.AddView(adp3,left, top, w, h)
Thanks for your soon response.. but, I got this error:
java.lang.IllegalArgumentException: method anywheresoftware.b4a.objects.ActivityWrapper.AddView argument 1 has type android.view.View, got agendame.turnos.anotherdatepicker
 
Upvote 0

pesquera

Active Member
Licensed User
Longtime User
Why do you want to add it without the designer? You can create an empty layout with only ADP and add it this way.
I already did the Activity by code, having a button above the list view
Wanted to show the calendar with that button, then fill that list view with the selected day
How can I then handle ADP?
Thanks for your help

Edited: done! thanks very much.. this code is on the button event
B4X:
Activity.LoadLayout("1")
glo_lst_DatePicker = Array(glo_DatePicker1)
glo_DatePicker1.Show
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Like any other view. Add it with the designer and right click to generate the variable.

If you want to change its position in your code then you will need to make targetLabel a public variable and then do something like:
B4X:
Dim p As Panel = ADP.targetLabel.Parent
Now you can move p as needed.
 
Upvote 0
Top