{"action":"created","issue":{"url":"https://api.github.com/repos/xamarin/Monkey.Robotics/issues/42","labels_url":"https://api.github.com/repos/xamarin/Monkey.Robotics/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/xamarin/Monkey.Robotics/issues/42/comments","events_url":"https://api.github.com/repos/xamarin/Monkey.Robotics/issues/42/events","html_url":"https://github.com/xamarin/Monkey.Robotics/issues/42","id":75815649,"number":42,"title":"Android Device reconnect exception","user":{"login":"KevinPou","id":11903231,"avatar_url":"https://avatars.githubusercontent.com/u/11903231?v=3","gravatar_id":"","url":"https://api.github.com/users/KevinPou","html_url":"https://github.com/KevinPou","followers_url":"https://api.github.com/users/KevinPou/followers","following_url":"https://api.github.com/users/KevinPou/following{/other_user}","gists_url":"https://api.github.com/users/KevinPou/gists{/gist_id}","starred_url":"https://api.github.com/users/KevinPou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KevinPou/subscriptions","organizations_url":"https://api.github.com/users/KevinPou/orgs","repos_url":"https://api.github.com/users/KevinPou/repos","events_url":"https://api.github.com/users/KevinPou/events{/privacy}","received_events_url":"https://api.github.com/users/KevinPou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-13T02:28:11Z","updated_at":"2015-05-14T02:34:50Z","closed_at":null,"body":"For each instance of the IDevice on Android side there is an event subscription. This is done using a Lambda. It is preferred to hook this up to an actual delegate for the purpose of event unsubscription. In the constructor of the Device the DeviceConnected event is being subscribed to. In case of disconnect, this event is not cleared. So the next time the same device is discovered and connected to, previous event gets the first notification. The GATT instance in the initial IDevice is null so it throws an exception. "},"comment":{"url":"https://api.github.com/repos/xamarin/Monkey.Robotics/issues/comments/101886282","html_url":"https://github.com/xamarin/Monkey.Robotics/issues/42#issuecomment-101886282","issue_url":"https://api.github.com/repos/xamarin/Monkey.Robotics/issues/42","id":101886282,"user":{"login":"smoy","id":1200287,"avatar_url":"https://avatars.githubusercontent.com/u/1200287?v=3","gravatar_id":"","url":"https://api.github.com/users/smoy","html_url":"https://github.com/smoy","followers_url":"https://api.github.com/users/smoy/followers","following_url":"https://api.github.com/users/smoy/following{/other_user}","gists_url":"https://api.github.com/users/smoy/gists{/gist_id}","starred_url":"https://api.github.com/users/smoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smoy/subscriptions","organizations_url":"https://api.github.com/users/smoy/orgs","repos_url":"https://api.github.com/users/smoy/repos","events_url":"https://api.github.com/users/smoy/events{/privacy}","received_events_url":"https://api.github.com/users/smoy/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T02:34:50Z","updated_at":"2015-05-14T02:34:50Z","body":"I submitted a pull request to address ConnectedDevices property: https://github.com/xamarin/Monkey.Robotics/pull/43"}}