-3
여기에서 [ "화요일", "목요일", "금요일", "금요일"]으로 관심을 가져 주므로이 문자열을 " daysArray를 사용하여 배열을 검사하지만 원하는 결과를 얻지 못했습니다. 고칠 수 있습니까? 이 [Ljava.lang.String;@e856c3b
배열에있는 문자열과 비교하면서 텍스트 뷰의 색상을 변경하십시오.
String daysOfInterest=map.get("daysOfinterest");
Log.d("DAYS OF INTEREST",daysOfInterest);
String[] daysArray = daysOfInterest.split(",");
Log.d("DAYS",daysArray.toString());
for(int i=0;i<daysArray.length;i++){
if(daysArray[i].equalsIgnoreCase("sunday")){
tvSunday.setBackground(ContextCompat.getDrawable(ActivitySavedCareAlerts.this,R.drawable.style_circle_filled_green));
tvSunday.setTextColor(ContextCompat.getColorStateList(getApplicationContext(),R.color.white));
}
if(daysArray[i].equalsIgnoreCase("monday")){
tvMonday.setBackground(ContextCompat.getDrawable(ActivitySavedCareAlerts.this,R.drawable.style_circle_filled_green));
tvMonday.setTextColor(ContextCompat.getColorStateList(getApplicationContext(),R.color.white));
}
if(daysArray[i].equalsIgnoreCase("tuesday")){
tvTuesday.setBackground(ContextCompat.getDrawable(ActivitySavedCareAlerts.this,R.drawable.style_circle_filled_green));
tvTuesday.setTextColor(ContextCompat.getColorStateList(getApplicationContext(),R.color.white));
}
if(daysArray[i].equalsIgnoreCase("wednesday")){
tvWednesDay.setBackground(ContextCompat.getDrawable(ActivitySavedCareAlerts.this,R.drawable.style_circle_filled_green));
tvWednesDay.setTextColor(ContextCompat.getColorStateList(getApplicationContext(),R.color.white));
}
if(daysArray[i].equalsIgnoreCase("thursday")){
tvThursday.setBackground(ContextCompat.getDrawable(ActivitySavedCareAlerts.this,R.drawable.style_circle_filled_green));
tvThursday.setTextColor(ContextCompat.getColorStateList(getApplicationContext(),R.color.white));
}
if(daysArray[i].equalsIgnoreCase("friday")){
tvFriday.setBackground(ContextCompat.getDrawable(ActivitySavedCareAlerts.this,R.drawable.style_circle_filled_green));
tvFriday.setTextColor(ContextCompat.getColorStateList(getApplicationContext(),R.color.white));
}
if(daysArray[i].equalsIgnoreCase("saturday")){
tvSaturday.setBackground(ContextCompat.getDrawable(ActivitySavedCareAlerts.this,R.drawable.style_circle_filled_green));
tvSaturday.setTextColor(ContextCompat.getColorStateList(getApplicationContext(),R.color.white));
}
}
return convertView;
}
만약에 그밖에 또 다른 것을 사용한다면 –
에는 2 개의 과오가있다 –
나의 실수를 보여줄 수 있습니까? – ajay110125