Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- txtCoordinates = (TextView) findViewById(R.id.LocationText);
- btnSetInfo = (Button) findViewById(R.id.setInfoButton);
- btnHelp = (Button) findViewById(R.id.getHelpButton);
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
- && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
- ActivityCompat.requestPermissions(this, new String[]{
- Manifest.permission.ACCESS_FINE_LOCATION,
- Manifest.permission.ACCESS_COARSE_LOCATION
- }, MY_REQUEST_CODE);
- } else {
- if (checkPlayServices()) {
- buildGoogleApiClient();
- createLocationRequest();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement