check below code, this may help you ...
in your layout file where the checkbox is checked ...
<CheckBox android:id="@+id/Check" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:layout_marginLeft="5dp" android:text=" Not connected " android:textSize="14sp" android:textStyle="bold" android:textColor="#ccc" android:clickable="true" android:focusable="true" android:button="@drawable/check"/>
in R / drawable / check.xml - use your star images here instead of my image.
<?xml version="1.0" encoding="UTF-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:state_window_focused="true" android:state_enabled="true" android:drawable="@drawable/check_on" /> <item android:state_checked="false" android:state_window_focused="true" android:state_enabled="true" android:drawable="@drawable/check_off" /> </selector>
source share