Reading items in ListView on Android

I’m trying to count the occurrences of an item in a ListView in Android Studio.
The ListView here lists the nearby devices with the help of Bluetooth.