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)
|
||||||
withContext(Dispatchers.Main) {
|
connectionManager.stopScan()
|
||||||
delay(5000L)
|
}
|
||||||
connectionManager.stopScan()
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Timer().schedule(object : TimerTask() {
|
Timer().schedule(object : TimerTask() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
|
|||||||
Reference in New Issue
Block a user