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

BluetoothLeGatt Sample Issue

$
0
0

Hi,

I'm trying to run the BluetoothLeGatt sample using a Samsung Galaxy Note II, and a Polar H7 Heart rate monitor. The device shows up (albeit numerous times), and I select one to view the details and data, but an exception gets thrown and I haven't been able to figure out the issue. It's blowing up on the following lines and throwing the error below.

Error: System.InvalidCastException: Cannot cast from source type to destination type.

Inside of public void DisplayGattServices (IList gattServices)

gattServiceAdapter = new SimpleExpandableListAdapter(
                    this,
                    (IList<IDictionary<string, object>>)gattServiceData,
                    Android.Resource.Layout.SimpleExpandableListItem2,
                    new String[] { LIST_NAME, LIST_UUID },
                    new int[] { Android.Resource.Id.Text1, Android.Resource.Id.Text2 },
                    (IList<IList<IDictionary<string, object>>>)gattCharacteristicData,
                    Android.Resource.Layout.SimpleExpandableListItem2,
                    new String[] { LIST_NAME, LIST_UUID },
                    new int[] { Android.Resource.Id.Text1, Android.Resource.Id.Text2 }
                );

Viewing all articles
Browse latest Browse all 204402

Trending Articles



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