Skip to content

Instantly share code, notes, and snippets.

@talhahasanzia
Created July 6, 2017 09:47
Show Gist options
  • Save talhahasanzia/7e59f51a1ee6c7fb466fae0193f33c5e to your computer and use it in GitHub Desktop.
Save talhahasanzia/7e59f51a1ee6c7fb466fae0193f33c5e to your computer and use it in GitHub Desktop.
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