I added some code like this to help me see which device is involved in this chicanery:
String device_name = device.getName(); if (device_name == null) device_name = "no name " + device.getAddress(); On Saturday, July 7, 2012 8:14:26 AM UTC-5, Jons Jean wrote: > > Same thing I face in past . . .it looks it is due to cache of bluetooth > something like this .. > What Happend according to me > Bluetooth 1st search for devices then get > its name . . > After searching devices when android bluetooth API try to get its name it > goes out of range . . that gives null .. . > if anyone explain more on this ? > > > > > On Sat, Jul 7, 2012 at 11:58 AM, gjs <garyjamessi...@gmail.com> wrote: > >> Hi, >> >> And by that logic device might be null as well... >> >> Maybe check the source code. >> >> Regards >> >> On Jul 7, 5:12 am, bob <b...@coolfone.comze.com> wrote: >> > I'm looking at the Bluetooth chat example: >> > >> > // When discovery finds a device >> > if (BluetoothDevice.ACTION_FOUND.equals(action)) { >> > // Get the BluetoothDevice object from the Intent >> > BluetoothDevice device = >> > intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); >> > // If it's already paired, skip it, because it's been >> > listed already >> > if (device.getBondState() != >> BluetoothDevice.BOND_BONDED) { >> > mNewDevicesArrayAdapter.add(device.getName() + "\n" >> + >> > device.getAddress()); >> > } >> > // When discovery is finished, change the Activity title >> > } >> > >> > I think there is a bug here because it assumes device.getName() does not >> > return null, when in fact it might. >> > >> > What do you guys think? >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > > > -- > ----------------------------------------------- > *Regards :* > *Muhammad Nasir Aftab* > ----------------------------------------------- > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en