だから、私はこのように見えるいくつかのxmlを解析しようとしています:
<image size="extralarge">
http://...
</image>
しかし、attrの値を文字列と比較することはできません。これが私のコードです:
albumImage.setTextElementListener(new TextElementListener() {
boolean imageGoodSize=true;
@Override
public void start(Attributes attributes) {
Log.v(TAG_LASTFM, "Image #" + attributes.getValue("size") + "#");
if(attributes.getValue("size")+"" == "extralarge" || attributes.getValue("size")+"" == "mega") {
imageGoodSize=false;
Log.w(TAG_LASTFM, "(imageGoodSize set to false");
}
else {
imageGoodSize=true;
}
}
ログには、サイズが「extralarge」に設定されていることが示されていますが、文字列「extralarge」と比較しようとすると、imageGoodSizeがfalseに設定されていません。私は何を間違っているのですか?
これがログです:
06-21 01:52:30.463: V/ParseMusic_LastFM(32610): Image #extralarge#