How to unbold the selected text in Edittext Android?
Button btnNormal = (Button) findViewById(R.id.btnNormal );
btnNormal .setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Spannable str = etx.getText();
StyleSpan[] ss = str.getSpans(selectionStart, selectionEnd, StyleSpan.class);
for (int i = 0; i < ss.length; i++) {
if (ss[i].getStyle() == android.graphics.Typeface.BOLD){
str.removeSpan(ss[i]);
}
}
etx.setText(str);
}
});