Android Question CSBuilder or BCText for clickable links that direct user to a URL

aedwall

Active Member
Licensed User
Longtime User
I have searched the forum to find how to make clickable text so that the user can click the text and then automatically goes to the specified web page. But I cannot find information on this. I already have CSBuilder in place. Can CSBuilder be used for this? It has "Clickable" and "EnableClickEvents" methods, but I don't see how to implement these so when a user clicks text he is taken to the web page in his browser. I also saw the sample in the BCText example, but it just changes the Title to the URL provided. I don't want to change a title - I want the user to go to the specified URL. Can someone please help me find what I am looking for? Thank you.

UPDATE: I have found my solution:

Code::
Sub btnSample_Click
  Dim cs99 As CSBuilder

  cs99.Initialize.Size(18).Append("Click to visit ").Append(CreateClickableWord("astrowin.org")).Append(".").PopAll

  EditText1.Text = cs99

  cs.EnableClickEvents(EditText1)
End Sub

Sub CreateClickableWord(Text As String) As CSBuilder
   Dim cs98 As CSBuilder

   Return cs98.Initialize.Underline.Color(Colors.RGB(0, 0, 255)).Clickable("word", Text).Append(Text).PopAll
End Sub

Sub Word_Click (Tag As Object)
  Dim ph As PhoneIntents       'requires Phone library

  StartActivity (ph.OpenBrowser("https://astrowin.org"))
End Sub
 
Last edited:
Top