Android Question Can not declare a CharSequence variable

Riddle Ling

Member
Licensed User
I can not declare a CharSequence variable

q01.png


log message:
B4X:
Unknown type: charsequence
Are you missing a library reference?

How do i declare a CharSequence variable?
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
I think you just need to declare a String to take the result of your CSBuilder. From Erel's turorial - "A String is one implementation of CharSequence."

So try:
B4X:
Private cs as CSBuilder

Private str as String = cs.Initialize.....
ListView1.AddSingleLine(str)

'Or you could just:

Private cs as CSBuilder
ListView1.AddSingleLine(cs.Initialize.....)

- Colin.
 
Upvote 0

Riddle Ling

Member
Licensed User
I think you just need to declare a String to take the result of your CSBuilder. From Erel's turorial - "A String is one implementation of CharSequence."

So try:
B4X:
Private cs as CSBuilder

Private str as String = cs.Initialize.....
ListView1.AddSingleLine(str)

'Or you could just:

Private cs as CSBuilder
ListView1.AddSingleLine(cs.Initialize.....)

- Colin.

Thank you!

I use this method:
B4X:
Dim cs As CSBuilder
cs.Initialize.Color(Colors.Red).Append(dateStr).Pop.Color(Colors.DarkGray).Append("  " & name).PopAll
ListView1.AddSingleLine(cs)

Now it works!
 
Upvote 0
Top