From 6ceda0b022f543839c1fc35f58befd80febe001f Mon Sep 17 00:00:00 2001 From: edr Date: Fri, 30 Jun 2023 17:45:04 +0200 Subject: [PATCH] Fix service discovery on android 12 --- app/src/main/AndroidManifest.xml | 1 + .../childmonitor/DiscoverActivity.java | 30 +++++++++++++++++++ .../rochefort/childmonitor/StartActivity.java | 23 ++++++++++++-- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d06a1df..91c9777 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -8,6 +8,7 @@ + 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { startActivity(new Intent(getApplicationContext(), MonitorActivity.class)); + } else if (requestCode == PERMISSIONS_REQUEST_MULTICAST) { + // its okay if the permission was denied... the user will have to type the address manually + startActivity(new Intent(getApplicationContext(), DiscoverActivity.class)); } } }