I am trying to apply Bulleted list and Numbering list in android edit-text when user press button. For that i have tried below code.
For Bullet
BulletSpan[] quoteSpan = str.getSpans(selectionStart, selectionEnd, BulletSpan.class);
// If the selected text-part already has UNDERLINE style on it, then we need to disable it
for (int i = 0; i < quoteSpan.length; i++) {
str.removeSpan(quoteSpan[i]);
exists = true;
}
// Else we set UNDERLINE style on it
if (!exists) {
str.setSpan(new BulletSpan(10), selectionStart, selectionEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); …Run Code Online (Sandbox Code Playgroud)