How do I add this function? (turn on location)

Use the ActivityStarter.

will elicit your device Settings Location screen

which displays differently depending on your Android operating system.

2 Likes