Skip to content

Instantly share code, notes, and snippets.

View redhead1999's full-sized avatar

Yury Kirilin redhead1999

View GitHub Profile
@redhead1999
redhead1999 / Bluetooth Android 12
Created June 11, 2023 18:54
Fixing Bluetooth-off crashing on Android 12 and higher
@RequiresApi(Build.VERSION_CODES.M)
@AndroidEntryPoint
class MainActivity : ComponentActivity() {
private val bluetoothManager by lazy {
applicationContext.getSystemService(BluetoothManager::class.java)
}
private val bluetoothAdapter by lazy {
bluetoothManager?.adapter
}
import SwiftUI
struct ContentView: View {
@EnvironmentObject var circleTimer: AirCircleTimerDemoViewModel
@State var showMenu: Bool = false
@ObservedObject var app: AppManager