嗨即時嘗試設置一個文本視圖的值與.setText在由線程運行的方法,但它被附加到TextView代替。參數字符串f是一個正在發送的方法,在for循環是這樣的:TextView setText附加代替
for (int j = 0; j < 5; j++) {
String[] string = array[j].split(":");
String y= string[0];
String x= string[1];
determineSeat(y, something, x);
}
}
private void determineSeat(String is, String cs, String f)
{
TextView txtHand = null;
String txt = null;
if (iSeat < cSeat) {
x = cSeat - iSeat;
if (x == 1) {
txtHand = (TextView) findViewById(R.id.txtHand8);
txt = txtHand.getText().toString();
txtHand.setText("");
txtHand.setText(txt + ":" + f);
}
}
XML:
<TextView
android:id="@+id/txtHand1"
android:layout_width="73dp"
android:layout_height="wrap_content"
android:layout_above="@+id/textView1"
android:layout_centerHorizontal="true"
android:text=" " />
我希望它是每次清除我把東西TextView的,而不是被附加的任何人都知道問題是什麼?
在Yosem發佈後開始撰寫,所以我沒有看到他的帖子。基本上,他說什麼。 – gmaster 2012-07-31 21:54:41
在我看來,你的回答更加清晰,更好地描述瞭如何解決問題。你有我的投票。 – 2012-07-31 21:56:20
Thx,對於答案,我實際上看到了什麼問題現在它更多,我忘記了我要做的txt字符串。很久很忙,我不知道我做錯了什麼,對不起。此主題已被回答 – Vern 2012-07-31 22:38:35