在Android 10中获取蓝牙本地mac地址

在Android 10中获取蓝牙本地mac地址,android,android-studio,android-bluetooth,Android,Android Studio,Android Bluetooth,由于安全原因,bluetoothAdapter.getAddress()将从Android Marshmallow返回02:00:00:00:00:00。 我尝试从android.provider.Settings.Secure获取,但仍然失败。 有没有办法获取本地蓝牙mac地址 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); se

由于安全原因,bluetoothAdapter.getAddress()将从Android Marshmallow返回02:00:00:00:00:00。 我尝试从android.provider.Settings.Secure获取,但仍然失败。 有没有办法获取本地蓝牙mac地址

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    bluetooth_address = android.provider.Settings.Secure.getString(getContentResolver(), "bluetooth_address");
    address = findViewById(R.id.address1);
    address.setText(bluetooth_address);
}

“我希望textView将设置为6B:3E:CB:2E:C4:C7,但实际输出为空。”

关于链接问题的一些好(不可接受)答案@我试过这些方法,但都不管用。。。或者简而言之,目前还不可能。