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 <[email protected]> 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 <[email protected]> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to