/** * @since Available in iOS 6.0 and later. */ public static NSObject observeRouteChange(final VoidBlock1<AVAudioSessionRouteChangeNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(RouteChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); AVAudioSessionRouteChangeNotification data = null; if (userInfo != null) { data = new AVAudioSessionRouteChangeNotification(userInfo); } block.invoke(data); } }); } /**
/** * @since Available in iOS 6.0 and later. */ public static NSObject observeRouteChange(final VoidBlock1<AVAudioSessionRouteChangeNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(RouteChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); AVAudioSessionRouteChangeNotification data = null; if (userInfo != null) { data = new AVAudioSessionRouteChangeNotification(userInfo); } block.invoke(data); } }); } /**
/** * @since Available in iOS 6.0 and later. */ public static NSObject observeRouteChange(final VoidBlock1<AVAudioSessionRouteChangeNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(RouteChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); AVAudioSessionRouteChangeNotification data = null; if (userInfo != null) { data = new AVAudioSessionRouteChangeNotification(userInfo); } block.invoke(data); } }); } /**