Android Question [SOLVED] Embedding clickable sub-string in label text

rabbitBUSH

Well-Known Member
Licensed User
I haven't been able to devise the correct question for a search to reveal if this is possible.

Since this is a speculative question: I don't have existing coding to add here. So, I trust that the following is an erudite explanation of what I am thinking of doing. (Incidentally, I have a workaround running, but the following would, to me, represent a more elegant solution or, at least, an alternative route for users to access the direction they are going in and the end-point information. The workaround is an indirect route to the user's download selection, for instance, and so not optimal.)

I thought the answer to this was in CSBuilder, StringUtils or StringBuilder ... but couldn't find references that answered this question.....

Its logical that adding a VIEW to a label can be done, but, whether that can be "embedded" into a string of text, or not, is debateable/ fantasy.

PROPOSITION
I have code that fills a label with text based on a user's input. The text is simple 'flat text' information about a topic. The text itself returns from a UTILITY module with a SELECT..CASE and then allocates a "flat" text string to a variable and the module returns the result for the caller to use. Imagination says that one should be able to set up a string with a clickable sub-string as one can do in a PHP/ HTML string, for instance.

I was wondering if its possible to make a portion of the text clickable such that it would invoke another activity, or, call a download code module to fetch something.

So where
B4X:
Label1.text = "This is how you calculate the last digit in PI"

Let's say CALCULATE could be clickable (either underlined as well, or bold text etc)

User taps CALCULATE and the module CalculatPIsEnd is called, its layout pops and something or other happens.

I guess the question is: can one hyperlink (ala "<a href>") a sub-string with coding?

Oh! Also, the APP has no need for webview or to connect to web-space other than that it is able to download files housed in the client's server-space....the latter is already incorporated.
 

rabbitBUSH

Well-Known Member
Licensed User
Upvote 0

rabbitBUSH

Well-Known Member
Licensed User
Try this one (I didn't):

Jaaaaaaaaaaaaaaaa . . . .finding that one was not simply intuitive . . . . . yikes . . . . that "BB mark-up" stuff looks useful and interesting . . .
 
Upvote 0

rabbitBUSH

Well-Known Member
Licensed User
@warwound have done so, it promises a solution, there is a lot to digest in that thread! Well, also in the one @LucaMs suggested. Obviously, what we look for is a solution leading to the least re-coding within a current project.

Thanks to you both for your inputs.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…