A
Android Question
Guest
I am facing one issue while using xamarin on Android.
I am calling StartScan api of the class BluetoothLeScanner. The issue which I am observing is that the scancallback results are coming in the UI thread even if I call the startScan from a different thread. I used a different HandlerThread to call the StartScan but still the scan callback results are coming on the UI thread. Is there a way I can change that behavior and not have the events coming on UI thread but on a different thread?
I can modify the OnScanResult api to post the event on a different thread. But I want the OnScanResult itself to not come on UI thread. Is there a way I can achieve this? I am not sure if it’s a bug in Android or Xamarin?
publicoverridevoid OnScanResult (ScanCallbackType type, ScanResult result)
The version of Xamarin studio is 5.9(build 464).
Android 5.1.1 (API 22)
I am calling StartScan api of the class BluetoothLeScanner. The issue which I am observing is that the scancallback results are coming in the UI thread even if I call the startScan from a different thread. I used a different HandlerThread to call the StartScan but still the scan callback results are coming on the UI thread. Is there a way I can change that behavior and not have the events coming on UI thread but on a different thread?
I can modify the OnScanResult api to post the event on a different thread. But I want the OnScanResult itself to not come on UI thread. Is there a way I can achieve this? I am not sure if it’s a bug in Android or Xamarin?
publicoverridevoid OnScanResult (ScanCallbackType type, ScanResult result)
The version of Xamarin studio is 5.9(build 464).
Android 5.1.1 (API 22)