class ServiceLocationsAdapter extends BaseAdapter {

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (!views.containsKey(locationNames.get(position))) {
            LayoutInflater inflater = (LayoutInflater) context.getSystemService(
                    Context.LAYOUT_INFLATER_SERVICE);

            View view = inflater.inflate(R.layout.location_picker_dropdown_item, null);
            view.setId(position + 2321);

            TextView text1 = view.findViewById(android.R.id.text1);
            text1.setText(LocationHelper.getInstance().getOpenMrsReadableName(locationNames.get(position)));
            views.put(locationNames.get(position), view);
        }

        refreshView(views.get(locationNames.get(position)),
                locationNames.get(position).equals(selectedLocation));

        return views.get(locationNames.get(position));
    }

    public  ServiceLocationsAdapter(Context context, List<String> locationNames);

}