I have tried the following code to insert icons into a layout created completely in code. It doesn't work. I just get a rectangle with a an X inside. Ditto with Material Icons. A simple sample would be appreciated. A picture is always worth a thousand words.
B4X:
'Search Button
Dim lblFontAwesome As Label
lblFontAwesome.Initialize("")
SearchButton.Initialize("SearchButton")
SearchButton.Typeface = lblFontAwesome.Typeface
SearchButton.Text = Chr(0xF179)
SearchButton.Background = cd
SearchButton.TextSize = 20
Activity.AddView(SearchButton, 70dip,500dip,70dip, 50dip)