if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED){ lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);}
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
这句话放在这个if语句就可以
!评论内容需包含中文