private static Spanned removeImageSpanObjects(Spanned spanned){
  SpannableStringBuilder builder=(SpannableStringBuilder)spanned;
  Object[] spannedObjects=builder.getSpans(0,builder.length(),Object.class);
  for (int i=0; i < spannedObjects.length; i++) {
    if (spannedObjects[i] instanceof ImageSpan) {
      ImageSpan imageSpan=(ImageSpan)spannedObjects[i];
      builder.replace(spanned.getSpanStart(imageSpan),builder.getSpanEnd(imageSpan),"");
    }
  }
  return spanned;
}

private static Spanned removeImageSpanObjects ( Spanned spanned ) { SpannableStringBuilder builder = ( SpannableStringBuilder ) spanned ; Object [ ] spannedObjects = builder . getSpans ( 0 , builder . length ( ) , Object . class ) ; for ( int i = 0 ; i < spannedObjects . length ; i ++ ) { if ( spannedObjects [ i ] instanceof ImageSpan ) { ImageSpan imageSpan = ( ImageSpan ) spannedObjects [ i ] ; builder . replace ( spanned . getSpanStart ( imageSpan ) , builder . getSpanEnd ( imageSpan ) , "" ) ; } } return spanned ; }
replaces all image objects in a spannable with nothing essentially removes them
