Java 如何检测此符号:'࿼';(虚线框中的OBJ)在Android中

Java 如何检测此符号:'࿼';(虚线框中的OBJ)在Android中,java,android,wordpress,Java,Android,Wordpress,我正在构建一个从Wordpress站点解析XML的应用程序。由于它在Wordpress上运行,所使用的许多HTML实际上作为文本的一部分存储在数据库中,当我尝试删除HTML时,出现以下符号:  不确定它是否在这里正确显示,但它是虚线框中的一个小OBJ符号,每当HTML解析器尝试解析图像时,它都会出现在文本中。基本上,我想要的是在这种情况发生时检测并删除它,但我在代码中检测它时遇到了困难 我开始使用的HTML代码如下所示: 05-21 11:26:05.402: I/System.out

我正在构建一个从Wordpress站点解析XML的应用程序。由于它在Wordpress上运行,所使用的许多HTML实际上作为文本的一部分存储在数据库中,当我尝试删除HTML时,出现以下符号:

不确定它是否在这里正确显示,但它是虚线框中的一个小OBJ符号,每当HTML解析器尝试解析图像时,它都会出现在文本中。基本上,我想要的是在这种情况发生时检测并删除它,但我在代码中检测它时遇到了困难

我开始使用的HTML代码如下所示:

    05-21 11:26:05.402: I/System.out(6546): 
    <a id="dd_start"></a><p><strong><a href="http://movieboozer.com/wp-content/uploads/2012/05/the-avengers-poster.jpg" onclick="return TrackClick('http%3A%2F%2Fmovieboozer.com%2Fwp-content%2Fuploads%2F2012%2F05%2Fthe-avengers-poster.jpg','the-avengers-poster')"><img class="alignleft  wp-image-22470" style="margin-left: 10px; margin-right: 10px;" title="the-avengers-poster" src="http://movieboozer.com/wp-content/uploads/2012/05/the-avengers-poster.jpg" onclick="return TrackClick('http%3A%2F%2Fmovieboozer.com%2Fwp-content%2Fuploads%2F2012%2F05%2Fthe-avengers-poster.jpg','the-avengers-poster')" alt="" width="208" height="308" /></a>By: <a href="http://neauxreelidea.blogspot.com/" onclick="return TrackClick('http%3A%2F%2Fneauxreelidea.blogspot.com%2F','Bill+Arceneaux')">Bill Arceneaux</a> </strong><strong></strong><strong>(<a href="#verdict">A Toast</a>)<br /></strong><strong>Note: There is a rating embedded within this post, please visit this post to rate it.  </strong></p><p>I used to collect comic books. Yes, I admit it. I got swept up in the fantasy of characters with unique abilities beyond those of normal people, fighting over exaggerated villains in an effort to save their hometown, and in some cases, the world. I mostly focused on the Superman comics &#8211; during the period of time when he became pure energy (I was probably one of the few that liked that story arc) &#8211; but I certainly hadn’t chosen a side in the DC vs. Marvel fight. Why pigeonhole yourself to just one brand?<span id="more-22462"></span></p><p><a href="http://movieboozer.com/wp-content/uploads/2012/05/200px-Action_Comics_1.jpg" onclick="return TrackClick('http%3A%2F%2Fmovieboozer.com%2Fwp-content%2Fuploads%2F2012%2F05%2F200px-Action_Comics_1.jpg','200px-Action_Comics_1')"><img class="aligncenter size-full wp-image-22467" title="200px-Action_Comics_1" src="http://movieboozer.com/wp-content/uploads/2012/05/200px-Action_Comics_1.jpg" onclick="return TrackClick('http%3A%2F%2Fmovieboozer.com%2Fwp-content%2Fuploads%2F2012%2F05%2F200px-Action_Comics_1.jpg','200px-Action_Comics_1')" alt="" width="200" height="277" /></a></p><p style="text-align: center;">Never got my hands on that issue.</p><p>My collection eventually stopped &#8211; only a little more than a handful of issues remain. Was this just a passing fancy? I think, personally, I just yearned for something more; something to give the pages a new life in my eyes, without insulting my devotion to the mythology. In the last decade, we’ve seen movies that range from bastardized toy commercials to unique creative interpretations. But, have we seen the best that comic book movies can be?</p><p>If we haven’t yet, <em>The Avengers</em> might just be it. The culmination of millions of dollars in production budgets and years of origin stories, this story has HIGH expectations:</p><p>After finding his way out of a cosmic abyss (as seen in <em>Thor</em>), Loki (Tom Hiddleston) makes a play and captures the Tesseract (as seen in <em>Captain America: The First Avenger</em>) – a cube of energy that could prove dangerous if in the wrong hands – from S.H.I.E.L.D. (as seen in all previous Marvel Cinematic Universe films). Nick Fury (Samuel L. Jackson) is forced to restart the Avengers Initiative – a program to bring together Earth’s mightiest heroes – in a last ditch effort to get the cube back and stop Loki from leading an alien army.</p><p>Of course, this means that Fury must bring together a group of people who probably shouldn’t be in the same room together; Iron Man (Robert Downey Jr.), CaptainAmerica(Chris Evans), Dr. Bruce Banner AKA The Hulk (Mark Ruffalo), Thor (Chris Hemsworth), Black Widow (Scarlett Johansson) and Hawkeye (Jeremy Renner). Can these heroes put their difference aside and conquer their own inner problems in time to save the world?</p><p><strong>A Toast</strong></p><p>Have you ever had an awesome-gasm? … Did I just invent a new word to describe a movie?</p><p><a href="http://movieboozer.com/wp-content/uploads/2012/05/hulk.jpg" onclick="r.......
我有一种感觉,这个问题可能与java有关,也可能与android系统有关

谢谢你的帮助

编辑: 这是HTML中符号出现的第一个位置:

<span id="more-22462"></span></p><p><a href="http://movieboozer.com/wp-content/uploads/2012/05/200px-Action_Comics_1.jpg" onclick="return TrackClick('http%3A%2F%2Fmovieboozer.com%2Fwp-content%2Fuploads%2F2012%2F05%2F200px-Action_Comics_1.jpg','200px-Action_Comics_1')"><img class="aligncenter size-full wp-image-22467" title="200px-Action_Comics_1" src="http://movieboozer.com/wp-content/uploads/2012/05/200px-Action_Comics_1.jpg" onclick="return TrackClick('http%3A%2F%2Fmovieboozer.com%2Fwp-content%2Fuploads%2F2012%2F05%2F200px-Action_Comics_1.jpg','200px-Action_Comics_1')" alt="" width="200" height="277" />

您可以使用从HTML内容中检索可显示的样式文本。要从样式化文本中删除图像信息,请使用以下代码:

public static Spanned removeImageSpanObjects(String inStr) {
    SpannableStringBuilder spannedStr = (SpannableStringBuilder) Html
            .fromHtml(inStr.trim());
    Object[] spannedObjects = spannedStr.getSpans(0, spannedStr.length(),
            Object.class);
    for (int i = 0; i < spannedObjects.length; i++) {
        if (spannedObjects[i] instanceof ImageSpan) {
            ImageSpan imageSpan = (ImageSpan) spannedObjects[i];
            spannedStr.replace(spannedStr.getSpanStart(imageSpan),
                    spannedStr.getSpanEnd(imageSpan), "");
        }
    }
    return spannedStr;
}
公共静态跨距removeImageSpanObjects(字符串指令){
SpannableStringBuilder spandstr=(SpannableStringBuilder)Html
.fromHtml(inStr.trim());
对象[]SpandObjects=SpandStr.getSpans(0,SpandStr.length(),
对象(类);
对于(int i=0;i
您可以使用从HTML内容中检索可显示的样式文本。要从样式化文本中删除图像信息,请使用以下代码:

public static Spanned removeImageSpanObjects(String inStr) {
    SpannableStringBuilder spannedStr = (SpannableStringBuilder) Html
            .fromHtml(inStr.trim());
    Object[] spannedObjects = spannedStr.getSpans(0, spannedStr.length(),
            Object.class);
    for (int i = 0; i < spannedObjects.length; i++) {
        if (spannedObjects[i] instanceof ImageSpan) {
            ImageSpan imageSpan = (ImageSpan) spannedObjects[i];
            spannedStr.replace(spannedStr.getSpanStart(imageSpan),
                    spannedStr.getSpanEnd(imageSpan), "");
        }
    }
    return spannedStr;
}
公共静态跨距removeImageSpanObjects(字符串指令){
SpannableStringBuilder spandstr=(SpannableStringBuilder)Html
.fromHtml(inStr.trim());
对象[]SpandObjects=SpandStr.getSpans(0,SpandStr.length(),
对象(类);
对于(int i=0;i
由于这会返回一个跨距,我该怎么处理它?我曾尝试使用toString,但这仍然给我带来了与以前相同的问题。此外,如果我尝试将扳手直接插入textview的setText,则会产生相同的错误,即到处都是OBJ符号。该示例删除了
元素。检查你的HTML代码,看看是哪些元素导致了你的案例中的OBJ符号。我会修改我的第一篇文章,说明符号在HTML中第一次出现的位置。这很奇怪。。。我甚至不能在符号第一次出现的地方发布代码。它只是一个空白。既然它返回了一个跨距,我该怎么处理它呢?我曾尝试使用toString,但这仍然给我带来了与以前相同的问题。此外,如果我尝试将扳手直接插入textview的setText,则会产生相同的错误,即到处都是OBJ符号。该示例删除了
元素。检查你的HTML代码,看看是哪些元素导致了你的案例中的OBJ符号。我会修改我的第一篇文章,说明符号在HTML中第一次出现的位置。这很奇怪。。。我甚至不能在符号第一次出现的地方发布代码。它只是显示为一个空白。