java/Android中包含的含义



首先向lit1发送0,向lit2发送300,结果是发现0/300灯
然后向lit1发送200,结果是发现200/300灯
然后向lit2发送0,结果是发现200/0灯

重启(lit1 200 &Lit2 300),将lit1改为20 &结果发现20/300灯
,然后将lit1改为200 &lit2至30,结果斑点200/30灯

重启(lit1 200 &lit2 300),将lit1改为0,结果为Spotted 200/300灯

我试了很多次,每次都发现>0,b在0然后发送带有0的lit1,
它不能通过"!spot.toString().contains(a+"/"+b)"

代码:

static SpannableString spot;
static ForegroundColorSpan y;
public class Span {
static SpannableString SPOT(int lit1, int lit2){
String a = Integer.toString(lit1), b = Integer.toString(lit2);
if(spot==null|| !spot.toString().contains(a+"/"+b)){
y = new ForegroundColorSpan(Color.YELLOW);
spot = new SpannableString("Spotted "+d+"/"+b+" lights");
spot.setSpan(y, 7, 7+d.length()+b.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
return spot;
}
}

真的需要帮助,因为我使用了很多的SpannableString方法。

200、300和20都以"0"结尾

编辑:

也许我说得不够清楚。"0/300"在"200/300"

最新更新