Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Issue implementing the deprecated AudioTrack.IOnRoutingChangedListener on Android M(23) phone

$
0
0

Hi,

I've an app which I'm wanting to target android 23 and above. I need to get notifications when the AudioDevice routing changes, but there API changes between android 23 and 24.

It looks straight forward to use the deprecated level 23 API - however, the level 23 AudioTrack.IOnRoutingChangedListener interface appears to incorrectly inherit from the level 24 IAudioRoutingOnRoutingChangedListener. This causes it to fall over when I try to instantiate the type on a Level 23 phone.

Is this intentional? It looks like a bug in the Xamarin library - if so could it be fixed, and is there a workaround?
[Obsolete("This class is obsoleted in this android platform")] [Register("android/media/AudioTrack$OnRoutingChangedListener", "", "Android.Media.AudioTrack/IOnRoutingChangedListenerInvoker", ApiSince = 23)] public interface IOnRoutingChangedListener : IAudioRoutingOnRoutingChangedListener, IJavaObject, IDisposable, IJavaPeerable { [Obsolete("deprecated")] [Register("onRoutingChanged", "(Landroid/media/AudioTrack;)V", GetOnRoutingChanged_Landroid_media_AudioTrack_Handler:Android.Media.AudioTrack/IOnRoutingChangedListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")] void OnRoutingChanged(AudioTrack audioTrack); }

[Register("android/media/AudioRouting$OnRoutingChangedListener", "", "Android.Media.IAudioRoutingOnRoutingChangedListenerInvoker", ApiSince = 24)] public interface IAudioRoutingOnRoutingChangedListener : IJavaObject, IDisposable, IJavaPeerable { [Register("onRoutingChanged", "(Landroid/media/AudioRouting;)V", "GetOnRoutingChanged_Landroid_media_AudioRouting_Handler:Android.Media.IAudioRoutingOnRoutingChangedListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")] void OnRoutingChanged(IAudioRouting router); }

Thanks!


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>