1

I have an apk which get the device name defined by the user.

For that I use this code (see at How do you get the user defined “Device Name” in android?):

BluetoothAdapter mBluetoothAdapter =  BluetoothAdapter.getDefaultAdapter();     
TextView txtName = (TextView) findViewById(R.id.name);
txtName.setText(mBluetoothAdapter.getName());

It works well on a android 4.1 / Samsung Galaxy tab3. Unfortunately when I test it on android 4.4 Samsung Galaxy tab pro, it doesn't work. On the new device I get the same result like android.os.Build.MODEL

If someone have an idea.

Thanks

Community
  • 1
  • 1
Imar
  • 13
  • 1
  • 3

1 Answers1

0

Try to get it from Settings.Secure:

Settings.Secure.getString(getContentResolver(), "bluetooth_name");
Micer
  • 8,731
  • 3
  • 79
  • 73