How to convert getColorStateList (JAVA->C# xamarin for android) -
this java code-:
mtext.settextcolor(getresources().getcolorstatelist(r.color.xml_color_selector))
tried convert c#(this code in getview)
mtext.settextcolor(parent.context.resources.getcolorstatelist(resource.drawable.xml_color_selector));;
unhandled exception:
android.content.res.resources+notfoundexception: file res/drawable/xml_color_selector.xml color state list resource id #0x7f0200a3
how convert c# code?
ps. xml_color_selector.xml
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="true" android:drawable="@color/menu_item_background_color_pressed" /> <!-- pressed tab --> <item android:state_pressed="true" android:drawable="@color/menu_item_background_color_pressed" /> <!-- non pressed tab --> <item android:state_pressed="false" android:drawable="@android:color/transparent" /> </selector>