Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Using google service location Api to get last know location
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
- setSupportActionBar(toolbar);
- handler = new Handler();
- textView = (TextView) findViewById(R.id.address);
- client = new GoogleApiClient.Builder(this)
- .addApi(LocationServices.API)
- .addOnConnectionFailedListener(this)
- .addConnectionCallbacks(this)
- .build();
- locationRequest = new LocationRequest();
- locationRequest.setInterval(1000);
- locationRequest.setFastestInterval(5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement