title: Remove Spanable image from EditText
body: <p>I am working on an messenger type application where I need to add Smilies in Edit Text during chat.For adding the Smilies I need to add real smiley image not smiley string.To Achieve this I am trying to add Spanable image dynamically on a EditText 
  This is my code</p>
  
  <pre><code> SpannableString ss = new SpannableString("abc");
      Drawable d = img.getDrawable();
      d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
      ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE);
      ss.setSpan(span, 0, 3, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
      et.setText(ss); 
  </code></pre>
  
  <p>I am following above code from link as <a href="https://stackoverflow.com/questions/3707251/how-can-i-adding-image-on-EditText-dynamically">How can i adding image on edittext dynamically?</a>,</p>
  
  <p>I am adding image in Edit Text and set the focus at end of Edit text where user's text end.Smilies adding fine as I want.
  Now when I want to removing smilies / adding more text to Edit Text its given unexpected output.
  Sometimes it remove text instead of smilies.Sometimes when I try to add more text/smiley it also again show old smilies that I already deleted on adding more text/smiley.
  Waiting for comments . . .</p>