I have found the solution, The code is correct but I was wrong when i used if statement. So I edited it like this and everything is fine:
Replace this
if (status == "0" || status == null) {
view.setBackgroundColor(Color.GREEN);
}if(status == "1"){
view.setBackgroundColor(Color.YELLOW);
}if(status == "2"){
view.setBackgroundColor(Color.CYAN);
}if(status == "3"){
view.setBackgroundColor(Color.RED);
}
With this:
if (status.equals(String.valueOf(0))) {
view.setBackgroundColor(Color.RED);
} else if(status.equals(String.valueOf(1))){
view.setBackgroundColor(Color.GRAY);
}else if(status.equals(String.valueOf(2))){
view.setBackgroundColor(Color.YELLOW);
}else if(status.equals(String.valueOf(3))){
view.setBackgroundColor(Color.CYAN);
}else{
view.setBackgroundColor(Color.GREEN);
}
return view;
}