Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid- Issue with Image Span Replacement in different android versions for the MultiAutoCompleteTextview Text
    text
    copied!<blockquote> <p>I Am adding the customized Clickable spans to my MultiAutoCompleteTextview. After adding 2 or more Contacts in That Edit Text. i am replacing the extra Spans to Image Span with Text Contains Count . My problem is that count is displaying different in lower end devices(i.e., 2.2) and higher end devices(i.e., 4.0). Please have a look into the below Pictures.</p> <p>Higher End Devices. <img src="https://i.stack.imgur.com/2IwMt.png" alt="Higher End Devices it is looking like this"></p> <p>LOwer End Devices <img src="https://i.stack.imgur.com/yARii.png" alt="enter image description here"></p> </blockquote> <p>So problem with Higher end devices. each extra chip is replacing the count 2 times. Here is the code for replacing the extra chip PLease find it.</p> <pre><code>void createMoreChipPlainText() { Editable text = getText(); int start = 0; int end = start; for (int i = 0; i &lt; CHIP_LIMIT; i++) { end = movePastTerminators(mTokenizer.findTokenEnd(text, start)); start = end; // move to the next token and get its end. } // Now, count total addresses. start = 0; int tokenCount = countTokens(text); MoreImageSpan moreSpan = createMoreSpan(tokenCount - CHIP_LIMIT); SpannableString chipText = new SpannableString(text.subSequence(end, text.length())); chipText.setSpan(moreSpan, 0, chipText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); text.replace(end, text.length(), chipText); mMoreChip = moreSpan; } </code></pre> <p>Is there any issue with replace method for editable class in android. Any one have any idea about this issue. please post your suggestions here</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload