Advertisement
Guest User

Untitled

a guest
Apr 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. //Using google service location Api to get last know location
  2. @Override
  3. protected void onCreate(Bundle savedInstanceState) {
  4. super.onCreate(savedInstanceState);
  5. setContentView(R.layout.activity_main);
  6. Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  7. setSupportActionBar(toolbar);
  8. handler = new Handler();
  9. textView = (TextView) findViewById(R.id.address);
  10. client = new GoogleApiClient.Builder(this)
  11. .addApi(LocationServices.API)
  12. .addOnConnectionFailedListener(this)
  13. .addConnectionCallbacks(this)
  14. .build();
  15. locationRequest = new LocationRequest();
  16. locationRequest.setInterval(1000);
  17. locationRequest.setFastestInterval(5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement