Enable Android bluetooth from documentation

前端 未结 1 527
旧巷少年郎
旧巷少年郎 2020-12-17 17:53

I am trying to get my Activity to enable Bluetooth with the Android 2.0.1 SDK, I am using some code straight from the documentation here: http://developer.android.com/guide/

相关标签:
1条回答
  • 2020-12-17 18:16

    The REQUEST_ENABLE_BT part is a request code that you should handle in your onActivityResult method. In that method you'll be notified whether or not enabling Bluetooth was successful.

    In that code snippet they didn't show the definition of it, but it's just a constant integer so you can set it to any value you like.

    See the documentation for startActivityForResult for more info about getting results back from activity launches.

    0 讨论(0)
提交回复
热议问题