changing typeface of combobox and adding items

harinder

Active Member
Licensed User
Hi..
I was looking to add a string of days as items to a combobox and also change typeface:
B4X:
    Dim cs As CSBuilder
    Dim myFont As Typeface = Typeface.CreateNew(Typeface.LoadFromAssets("myfont.ttf"), Typeface.STYLE_BOLD)
    Dim s() As String =Array  ("-","7","10","14","30","60","90","180","365")
    For i=0 To s.Length -1
       spnrmks.cmbBox.Addall(Array (cs.Initialize.Typeface(myFont).Append(i).PopAll))
    Next
But I am getting error:
java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.String[]

Halp..Thnx
 

mangojack

Well-Known Member
Licensed User
Change to
B4X:
Dim s() As String = Array As String("-","7","10","14","30","60","90","180","365")
Strangely, compiling without error , then removing "As String" it did not error again in subsequent compiles (debug mode)
 

mangojack

Well-Known Member
Licensed User
I have also made same reply to to correctly posted question in Android forum ..
 

harinder

Active Member
Licensed User
i think i posted my question in general discussion in error. I have reposted in Android questions again.
Can Erel please delete it.

thanks mangojack
 
Top