Mock Locations option keeps turning off
Things you can try: 

If testing on an actual device, make sure that you have the "Developer options" turned on, and a check on the "allow mock locations" checkbox.

From the phone's location settings, make sure the location is not gotten by using Wi-Fi and mobile networks, so only "GPS" or in some models "Device Only" checked.

Finally, if you are developing the app yourself and/or have access to it's manifest; check to see that the manifest contains the correct permission:

&lt;uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /&gt; 


for further help concerning development issues, you can read from this post on stack overflow for assistance: https://stackoverflow.com/questions/2531317/android-mock-location-on-device

I left this answer here for further reference in case it will be useful for others.