android - Error inflating class <unknown> -


i trying work way in ui. trying set statelistdrawable list entries. trying change color of list item's layout when item pressed, , while list item pressed want change color of text well.

i getting following error stack:

e/androidruntime(  360): fatal exception: main e/androidruntime(  360): android.view.inflateexception: binary xml file line #8: error inflating class <unknown> e/androidruntime(  360):    @ android.view.layoutinflater.createview(layoutinflater.java:513) e/androidruntime(  360):    @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56) e/androidruntime(  360):    @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:563) e/androidruntime(  360):    @ android.view.layoutinflater.rinflate(layoutinflater.java:618) e/androidruntime(  360):    @ android.view.layoutinflater.inflate(layoutinflater.java:407) e/androidruntime(  360):    @ android.view.layoutinflater.inflate(layoutinflater.java:320) e/androidruntime(  360):    @ android.view.layoutinflater.inflate(layoutinflater.java:276) 

the xml inflated following:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/help_list_container"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:padding="5dip"     android:background="@drawable/default_list_selection">     <textview android:id="@+id/help_list_text"          android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:textsize="16sp"         android:textcolor="@drawable/help_text_color">     </textview> </linearlayout> 

i can program work if remove android:textcolor property xml. there way can use statelistdrawable control texcolor of listitem xml?

the statelistdrawable works android:background in linearlayout, won't textcolor property of textview. state list xml following:

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android">     <item android:drawable="@color/white"               android:state_pressed="true" />     <item android:drawable="@color/black" /> </selector> 

any response appreciated.

i wrongly using drawable change textcolor of textview. instead, should have used colorstatelist

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android">    <item android:state_pressed="true" android:color="@color/white" />    <item android:color="@color/black"/>  </selector> 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -