Can anybody fix the mistake of switch?(Android)-ThrowExceptions

Exception or error:

Can anybody tell me to fix that switch I have 10 times but then to switch is not showing only the off text and when I click at it then on text no switch at all please anybody help me.!!
Output is
Screenshot of output

Here is the code

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical">

    <Switch
    android:id="@+id/simpleSwitch"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:checked="true"
   android:layout_centerVertical="true"
   android:layout_centerHorizontal="true"
    android:textOn="On"
    android:textOff="Off"
    android:gravity="center"
    android:textColor="#008F36"/>
</RelativeLayout>```

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *