How to prevent deleting a spannable in an EditText
<p>Is there a way to prevent a user from deleting or modifying a spannable in an EditText?  More specifically, I have an ImageSpan as the first character of the EditText.  I want to ensure the user cannot delete that ImageSpan.</p>

<p>I realize I can use TextWatcher and replace the ImageSpan if the user deletes it.  That's rather ugly and I'm hoping there's a way to prevent the deletion in the first place.</p>

<p>Here's a snip of code where I set the text value:</p>

<pre><code>Bitmap bitmap = &lt;bitmap from elsewhere&gt;;
String text = &lt;text to display after ImageSpan, from elsewhere&gt;;

SpannableString ss = new SpannableString (" " + text);
ImageSpan image = new ImageSpan (getContext(), bitmap, ImageSpan.ALIGN_BOTTOM);
ss.setSpan (image, 0, 1, 0);

setText (ss);
</code></pre>