0
我在這裏有一個非常奇怪的錯誤。Android:應該是空的字符串有奇怪的內容
我設置一個字符串空:
String s = "";
但有時當我以後使用它,它包含:
"[email protected][State = 0, empty queue]"
這發生在後臺線程。
任何想法這可能嗎?
更新:
我被要求提供更多的代碼。 完整的代碼會太多,但這裏有更多信息: 問題發生在使用AsyncTask啓動的後臺任務中。
String s = "";
String t = "";
...
... Here happens some other stuff, that does not use s or t
...
s += "x";
t += "y" + s + "z";
Log.d("TEST", t);
Output most of the time: "yxz"
Output sometimes: "[email protected][State = 0, empty queue]xz"
我使用的Java版本7更新51
更多代碼是必需的。在哪裏使用's',以及在哪裏打印或記錄's'字符串? – JRomero
你的問題是關於線程/鎖而不是關於空字符串 – Phong