Skip to content

Instantly share code, notes, and snippets.

View tugcekeser's full-sized avatar

R. Tugce Keser tugcekeser

  • Facebook
  • San Francisco Bay Area
View GitHub Profile
@irfaan008
irfaan008 / EnableGpsAutomaticallyInAndroid.java
Last active June 25, 2020 10:26
Enable Gps automatically if it is turned off. Similar to what OLA cab does. However to comply with policy it shows a popup to user with OK and CANCEL button. Still its better than showing location setting screen to user
package com.irinnovative.enablegps;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.google.android.gms.common.api.GoogleApiClient;