Hi Rajeev,

Yes, problem is solved,

Solution is
declare : 

private static final int REQUEST_ENABLE_BT = 1;

private BluetoothAdapter mBluetoothAdapter;
 
in onCreate() method

final BluetoothManager bluetoothManager =
        (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
mBluetoothAdapter = bluetoothManager.getAdapter(); // use this to get the 
bluetooth adapter


if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
    Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
    startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}


Below link will be useful

https://developer.android.com/guide/topics/connectivity/bluetooth-le.html


with best regards,

Jagdish




On Wednesday, February 22, 2017 at 1:08:54 AM UTC+5:30, RJ wrote:
>
>
> Hi Jag, were you able to solve the mBluetoothAdapter issue? I have the 
> same issues. 
>
> Regards,
> Rajeev
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/625274ec-f8e0-4eb0-8045-b59e1a0dde1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to