How can I set the theme change in the widget when the theme change is made in my Android application?
I tried such a method, but I did not get any results.
int themeMode = mContext.getSharedPreferences("DH_MODE", Context.MODE_PRIVATE).getInt("DH_MODE", 0);
switch (themeMode){
case 0: {
// Gündüz modu
rv.setImageViewResource(R.id.img_flame, R.drawable.evening_logo);
rv.setTextViewText(R.id.txt_title," Gündüz modu");
rv.setTextColor(R.id.txt_title, Color.parseColor("#000000"));//siyah
break;
}
case 1: {
//Gece modu
rv.setImageViewResource(R.id.img_flame, R.drawable.evening_logo); // logolar da değişecekse diye imageview i de ekledim
rv.setTextViewText(R.id.txt_title," Gece modu");
rv.setTextColor(R.id.txt_title, Color.parseColor("#ffffff"));//beyaz
break;
}
case 2: {
//Gün batımı modu
rv.setImageViewResource(R.id.img_flame, R.drawable.evening_logo);
rv.setTextViewText(R.id.txt_title," gün batımı modu ");
rv.setTextColor(R.id.txt_title, Color.parseColor("#ffffff"));//beyaz
break;
}
case 3:{
rv.setImageViewResource(R.id.img_flame, R.drawable.evening_logo);
rv.setTextViewText(R.id.txt_title," akşam modu");
rv.setTextColor(R.id.txt_title, Color.parseColor("#ffffff"));//beyaz
}
}