Location sensor not working

I am using location sensor to determine whether the GPS location is turn on in the mobile or not so the workflow is very simple.
Screen 1 loads checks whether location is on, if on then goes to screen GOE or else NOGPS.
But every time it fails to check that and always opens screen GOE even if GPS is off !!

IMG_20211125_000144

Show the blocks for what happens when the GPS is turned off.

Also, close screens properly or you will run into memory issues.

As shown in picture if location is off open another screen NOGPS.

Try like this and see if it works for you

1 Like

@dora_paz Wow it works !

How to open permission settings of my application by using activity starter and a button, I don’t know what’s next after Android.activity…

see the Get Available SSIDs example here App Inventor Extensions: WiFi | Pura Vida Apps about how to do it.

Taifun