You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
protected void onCreate(Bundle savedInstanceState) {
...
CheckPermissions(new String[] { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION,
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.BLUETOOTH_ADMIN});
}
private void CheckPermissions(String[] aPermission)
{
ArrayList<String> aRequest = new ArrayList<String>();
for (int i=0; i<aPermission.length; i++)
if (ContextCompat.checkSelfPermission(this,aPermission[i])
!= PackageManager.PERMISSION_GRANTED)
aRequest.add(aPermission[i]);
if (aRequest.size() > 0)
ActivityCompat.requestPermissions(this, aRequest.toArray(new String[0]), 1);
}
As i am a beginner i did not care to update
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
The text was updated successfully, but these errors were encountered:
details: https://stackoverflow.com/questions/58428763/android-10-not-working-with-ble-bluetooth-scanning
add to manifest:
You may want to change in MainActivity:
The text was updated successfully, but these errors were encountered: