fix: ask for BLE permission before scanning
This commit is contained in:
@@ -136,16 +136,17 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
if(hasRequiredRuntimePermissions()) {
|
||||
connectionManager.startScan()
|
||||
|
||||
connectionManager.startScan()
|
||||
lifecycleScope.launch {
|
||||
|
||||
lifecycleScope.launch {
|
||||
|
||||
withContext(Dispatchers.Main) {
|
||||
delay(5000L)
|
||||
connectionManager.stopScan()
|
||||
withContext(Dispatchers.Main) {
|
||||
delay(5000L)
|
||||
connectionManager.stopScan()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer().schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
|
||||
Reference in New Issue
Block a user