Hocam bu kodu denedim fakat ContextCompat altında getcolor yok, getDrawable var.
ContextCompat.getColor(context, R.color.color_name)
compile 'com.android.support:support-v4:23.0.1'
deneyebilir misin ? Kolaylıklar dilerim.
--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 01:16:08 -->-> Daha önceki mesaj 01:06:11 --
public static final int getColor(Context context, int id) {
final int version = Build.VERSION.SDK_INT;
if (version >= 23) {
return ContextCompatApi.getColor(context, id);
} else {
return context.getResources().getColor(id);
}
}
fonsiyon olarak böyle yazılabilir.