How to handle Toggle Switch in appium

Hello,
I need to handle the toggle switch in android application.
Is there any predefined method which i can use to toggle the switch or i will have to swipe in order to change the state from OFF to ON or vice versa.
Please refer to the attached screenshot.

Find the toggle switch element and click on it. If you want to check the state of the switch (On/Off) then you can get the property of the element and then do appropriate action. Click will on or off the switch. Hope that helps

Thanks it worked…!!!

Hello Guys

Can some one help me please

I need to check the Toggle button status - Enabled or Disabled

I tried using get Attribute (“value”) but it returns null in both case on Hybrid App built on Ionic and running on Android

Can any one suggest how to achieve this

Thanks
Saurabh