Default Disable magnetic sensor

When I flip the sview cover on the back of the phone it always trigger the sview window so Iam looking to a method to disable it temporarly
Thanks