I want to make the text stored inside a string variable to bold.
String buttonText = t.getText().toString(); String val = map.get(buttonText);
new MaterialDialog.Builder(LearningMode.this)
.iconRes(BalloonColor.get(2))
.limitIconToDefaultSize()
.title("Meaning")
.content(buttonText+"\n"+val)
.positiveText("Continue")
.cancelable(false)
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
mover.resume();
}
})
.show();
at .content(buttonText+"\n"+val) i want the string stored inside this to become bold. i have tried html.fromhtml it is not working
like this Html.fromHtml(" < b > "+buttonText+" < / b >")
added space in the above as it is converting to bold
and other methods like declaring in strings.xml with < b > wont work here as i'm dealing it programmatically here!
ultimately when the string button text is displayed in the output sholud be bold.
i have already referred this Set TextView text from html-formatted string resource in XML
Update:
There is no textview used.
Someone please help!