Cho em hỏi là sao em lại bị lỗi java.lang.NullPointerException: println needs a message khi em chạy cái thread. Cái Log đầu ( Luồng xử lí lệnh … ) hoạt động bình thường nhưng sau đó thì tạch luôn.
Mong bác nào biết chỉ giáo cho.
Code:
public void timkiemcaulenh(final String x) {
Thread th = new Thread(new Runnable() {
@Override
public void run() {
Log.e("Luồng xử lí lệnh "+x, "-------------");
String s = x;
s=s.trim();
s=s.toLowerCase();
s=xoakhoangtrang(s);
Log.e("tìm xâu s:"+s,share2.getString(s, null));
if(share2.getString(s, null).equals(null)==false){
String[] temp= null;
temp=s.split(" ");
for(int i = 0; i<temp.length;i++){
Log.e("so sánh "+x +" số dc add thứ "+i+" là:", temp[i]);
count[Integer.parseInt(temp[i])]++;
if(count[Integer.parseInt(temp[i])]>max){
max=count[Integer.parseInt(temp[i])];
maxpoint=i;
}
}
}
}
});
th.start();
}

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?