Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.
This repository was archived by the owner on May 15, 2024. It is now read-only.

[Bug] Connectivity.ConnectivityChanged handler does not work when targeting API 34 on Android 14 phones / emulators. #2130

@salvadorjesus

Description

@salvadorjesus

Description

Connectivity.ConnectivityChanged handler does not work when targeting API 34 on Android 14 phones / emulators.

Other combinations of API levels and Android versions seem to work.

This is the same bug already reported and fixed in Maui: Adding a Connectivity.ConnectivityChanged handler does not work on Android 14 #19949.

Code snippet

Adding the handler

Connectivity.ConnectivityChanged += Connectivity_ConnectivityChanged;

Do not call the method:

        private async void Connectivity_ConnectivityChanged(object sender, ConnectivityChangedEventArgs e)
        {
            Console.WriteLine("Connectivity changed");
        }

Steps to Reproduce

Download and deploy the reproduction repo.

Target API 33 or run it on an Android 13 emulator. When you make changes on the connectivity (switch flight mode on and off), the line 'connectivity changed' appears on the console (expected behavior).

When compiling for API 34 and running in an Android 14 emulator, nothing appears on console (Connectivity_ConnectivityChanged is never reached).

Reproduction Link

Reproduction repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions