Guest User

Untitled

a guest
Jan 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. private IBluetoothProfileServiceListener _bluetoothProfileServiceListener;
  2.  
  3. public BluetoothAdapter MBluetoothAdapter;
  4.  
  5. MBluetoothAdapter = BluetoothAdapter.DefaultAdapter;
  6. _bluetoothProfileServiceListener = new ServiceListener();
  7. MBluetoothAdapter.GetProfileProxy(BaseContext,
  8. _bluetoothProfileServiceListener, ProfileType.A2dp);
  9.  
  10. private class ServiceListener : IBluetoothProfileServiceListener
  11. {
  12. public void Dispose()
  13. {
  14.  
  15. }
  16.  
  17. public IntPtr Handle { get; }
  18. public void OnServiceConnected(ProfileType profile,IBluetoothProfile proxy)
  19. {
  20. if (profile == ProfileType.A2dp)
  21. {
  22. //service connected
  23. }
  24.  
  25. }
  26.  
  27. public void OnServiceDisconnected(ProfileType profile)
  28. {
  29.  
  30. }
  31. }
Add Comment
Please, Sign In to add comment