Change color of calendar dates android

Hi, I am trying to color the date selected on my calendar. I tried String todayDate = (mDay + "/" + mMonth + "/" + mYear);

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)); } 

I also tried context.getRes .....

Nothing seems to work. The color of the date never changes.

Can anyone help? thanks

0
source share
1 answer
 setTextColor(Color.GREEN); 

This is what I use to change my colors. Works with buttons, hope this works for you too.

0
source

Source: https://habr.com/ru/post/957245/


All Articles