Tobiah, This is what I used to get adapter: mBtAdapter = (BluetoothAdapter) this.getApplicationContext().getSystemService(BLUETOOTH_SERVICE);
Doug On Thursday, February 13, 2014 6:31:13 PM UTC-5, Tobiah wrote: > > > I'm going through the Bluetooth docs and right off I > am having a problem. The code below is cut right from > > http://developer.android.com/guide/topics/connectivity/bluetooth.html > > BluetoothAdapter mBluetoothAdapter = > BluetoothAdapter.getDefaultAdapter(); > if (!mBluetoothAdapter.isEnabled()) { > Intent enableBtIntent = new > Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); > startActivityForResult(enableBtIntent, > REQUEST_ENABLE_BT); > } > > I'm setting REQUEST_ENABLE_BT to an arbitrary integer. > > I tried running this on two devices, starting with > bluetooth off. On the tablet, the app crashes when checking > mBluetoothAdapter.isEnables(). On my Galaxy note 3, it > makes it past that check, but then the app crashes when > startActivityForResult() is called. > > There is no output in the Logcat in either case. > > Thanks for any help! > > Tobiah > -- 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 --- 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]. For more options, visit https://groups.google.com/groups/opt_out.

