Created
July 6, 2017 09:47
-
-
Save talhahasanzia/7e59f51a1ee6c7fb466fae0193f33c5e to your computer and use it in GitHub Desktop.
Reduce friction with Location API - new approach : https://android-developers.googleblog.com/2017/06/reduce-friction-with-new-location-apis.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
FusedLocationProviderClient client = | |
LocationServices.getFusedLocationProviderClient(this); | |
client.requestLocationUpdates(LocationRequest.create(), pendingIntent) | |
.addOnCompleteListener(new OnCompleteListener() { | |
@Override | |
public void onComplete(@NonNull Task task) { | |
Log.d("MainActivity", "Result: " + task.getResult()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment