我正在做一个简单的聊天应用程序,我想在编写消息时在edittext上显示笑脸。我用它来识别哪些字符将通过ImageSpan由Image替换(仅当在EditText上插入笑脸字符时才会调用):for(index=start;indexeditable.length())continue;if(emoticons.containsKey(editable.subSequence(index,index+1).toString())){intlength=1;Drawabledrawable=context.getResources().getDrawable(emoticons.get(e