Android Question CSBuilder ClickableWord Error

Kiran Raotole

Active Member
Licensed User
In my, I'm using CustomListview and labels.
on one label I clickable work like this :
B4X:
    Dim cs As CSBuilder
    cs.Initialize.Append(CreateClickableWord("9225146803"))
    Label1.Text = cs
    cs.EnableClickEvents(Label1)

Word click :
B4X:
Sub Word_Click (Tag As Object)
    Log("aaaaaa" & Tag)
End Sub

It shows error Log:
customlistview_getitemfromview (java line: 430)
java.lang.ClassCastException: android.view.ViewRootImpl cannot be cast to android.view.View


Whats problem?
 

Star-Dust

Expert
Licensed User
Longtime User
Try adding PopAll to the end of the CSBuilder variable
 
Upvote 0

Kiran Raotole

Active Member
Licensed User
Try adding PopAll to the end of the CSBuilder variable
B4X:
Sub CreateClickableWord(Text As String) As CSBuilder
    Dim cs As CSBuilder
    Return cs.Initialize.Underline.Color(0xFF00D0FF).Clickable("word", Text).Append(Text).PopAll
End Sub

I create this function for that clickable command.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
It shows error Log:
customlistview_getitemfromview (java line: 430)
java.lang.ClassCastException: android.view.ViewRootImpl cannot be cast to android.view.View


Whats problem?
these errors indicate that you are trying to cast a CustomView with a standard view.
You have to look for the error somewhere else, not in the CSBuilder
 
Upvote 0
Top