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语句就可以
版权声明:《 使用GPS提示的问题是Call requires permission which may be rejected by user: code should explicitly check to s 》为admin原创文章,转载请注明出处!
最后编辑:2022-9-21 14:09:10