Skip to content

Commit 2e4bfa3

Browse files
committed
Fix: Bluetooth permission UI logic
1 parent 8db6317 commit 2e4bfa3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/dev/stenglein/connectivitycontroller/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ class MainActivity : ComponentActivity() {
8787
Manifest.permission.BLUETOOTH_CONNECT
8888
)
8989
) {
90-
requestPermissionLauncher.launch(Manifest.permission.BLUETOOTH_CONNECT)
91-
} else {
9290
Toast.makeText(
9391
this,
9492
"Go to Permissions -> Nearby devices -> Allow to enable Bluetooth",
@@ -100,6 +98,8 @@ class MainActivity : ComponentActivity() {
10098
val uri = Uri.fromParts("package", packageName, null)
10199
intent.data = uri
102100
startActivity(intent)
101+
} else {
102+
requestPermissionLauncher.launch(Manifest.permission.BLUETOOTH_CONNECT)
103103
}
104104
}
105105

0 commit comments

Comments
 (0)