Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 如何在android中以编程方式启用/禁用蓝牙
嗨,我正在开发一个必须以编程方式打开蓝牙的应用程序,你能告诉我如何一步一步地做到这一点,谢谢
这段代码对我有用。你可以试试这个
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (!mBluetoothAdapter.isEnabled()) { //Play with bluetooth }else{ mBluetoothAdapter.disable(); }