Reputation: 6381
I'm working on an application in Android,and I follow the Codesuggestion from the Android developers page
When I type the code:
private LeDeviceListAdapter mLeDeviceListAdapter;
It has error message:
LeDeviceListAdapter cannot be resolved to a type
What do I have to fix this error??
Upvotes: 19
Views: 27140
Reputation: 1311
The LeDeviceListAdapter
class is not built into the Android APIs; you have to create it yourself. I found the class -- the one that the Android tutorials intended for you to use -- at this link:
Just search the page for "LeDeviceListAdapter".
Upvotes: 11
Reputation: 1829
The code is actually only extracts of the BTLE sample project inside the Android SDK. You should read the article with the sample project together.
The path of the sample project is /sdk/samples/android-18/legacy/BluetoothLeGatt
If you are only interested in what LeDeviceListAdapter is , here is the code in pastebin
Also I recommend you to read about how AdapterView (ListView's parent) and Adapter works. Nothing to do with the actual BLE work, but you will suffer in understanding the sample code if you don't understand what's happening.
Upvotes: 14