嗨我想爲日曆視圖中選擇的日期着色。我試過 String todayDate =(mDay +「/」+ mMonth +「/」+ mYear);更改日曆日期的顏色android
Toast.makeText(this, "TODAYS DATE" + todayDate, LENGTH_SHORT).show();
Cursor cursor = myDatabase.rawQuery("select * from " + Calms.DATABASE_FLARE_TABLE, null);
//calendarView.setDateTextAppearance(Integer.parseInt("@+color/orange"));
for(int count=1; count<=cursor.getCount(); count++)
{
cursor.moveToNext();
String savedDate = cursor.getString(2);
//calendarView.setDateTextAppearance(getResources().getColor(R.color.orange));
//calendarView.setDateTextAppearance(R.color.color);
Toast.makeText(this, "DATE IN DB: "+ savedDate, LENGTH_SHORT).show();
Toast.makeText(this, "next", LENGTH_SHORT).show();
if (savedDate.equals(todayDate))
{
Toast.makeText(this, "IN IF!!", LENGTH_SHORT).show();
//calendarView.setDateTextAppearance(Integer.parseInt("@color/orange"));
calendarView.setDateTextAppearance(getResources().getColor(R.color.orange));
}
我也曾嘗試context.getRes .....
似乎沒有任何工作。日期的顏色永遠不會改變。
任何人都可以提供幫助嗎? 謝謝
[Android CalendarView for Showing Events]可能的副本(http://stackoverflow.com/questions/16556254/android-calendarview-for-showing-events) – blahdiblah 2013-11-06 00:28:19