Button • Custom: Icon, Radius, Border, Color, Gradient, HTML Text, Text Alignment

You need to add more values to the list, the position of the value in the list is applied to the button in the same position as that value.

  • I also see that you are creating lists of lists, you should just create a list like in the example.

1 Like

Hi, thanks for your extension, buttons look great!. Could you please explain why the
htmlTexts will not accept a joined string? One on the top fails with Runtime Error gnu.lists.FString cannot be cast to java.lang.String. I have been dabbling in C all my life however know nothing about java. Thanks

Hello, try closing the HTML tags in your text blocks, I don't know if this is really the solution but maybe ? :man_shrugging: :sweat_smile:

Nico

Hi, thanks for the tip however it did not help. Have been googling and it may be a type conversion issue in the extension?

This sometimes happens with extensions and other things in AI2. Try using a local variable to build the join blocks, then place that in the extension block.

example

Thanks for the tip however I have tried every way I can imagine. Pass the built string to a procedure, used a local variable in the procedure to build the string and then pass that to the extension (as you just suggested). No luck.

I tried using join with the full string and appended an empty text and that failed. If you double reverse the string that fails as well. Seems to me like some type casting issue with the extension that is incompatible with Mit App Inventors passed string type. (Although I don't know anything about Java...)

For now, looks like you will have to build your html all in one text block.

Yes, thanks for your input!

This appears to be a similar problem encountered by the BLE writestrings function that has now been corrected. I'm guessing the automatic type casting is not working because the sting is passed as a list (of objects) rather than a string and the type casting needs to be handled by the function?

I'll leave it at that and hopefully the author can correct me or solve it. Regards, Daryl

Thanks for reporting the bug. I checked it. When joining strings, I get this error:
gnu.lists.FString cannot be cast to java.lang.String

This happened because App Inventor internally uses a type called FString for strings, but the code tried to convert it directly to String with (String), which failed.

I've now used .toString() to convert any text type, including FString, to String, and it's fixed.

v1.0.6 Ago 17, 2025.

1 Like

Thanks very much! Very good extension.