Feature in Ranging beacons in Airport Demo app

Hi,
I am working with the Demo Airport app.
Presently, the onBeaconsDiscovered(Region region, List list) method of BeaconManager.RangingListener interface is being called continuously. My problem is that when i add any UI, it gets executed even if the same beacon is discovered. I want to implement it in such a way that the UI changes only when the nearest beacon discovered is different from the one found in the last search.
I have tried to create a field of beacon while implementing the BeaconManager.RangingListener interface and compare and update it with the beacon discovered, but doesn’t work. Can anyone help?

Check out our Proximity Content example:

https://cloud.estimote.com/#/apps/add/proximity-content-multiple
or from:
https://github.com/Estimote/Android-SDK/tree/master/Templates/ProximityContent

It has a NearestBeaconManager class which only invokes a listened method onNearestBeaconChanged when … the nearest beacon has changed (: Maybe you can use it in your own app you’re working on.

https://github.com/Estimote/Android-SDK/blob/master/Templates/ProximityContent/app/src/main/java/com/estimote/proximitycontent/estimote/NearestBeaconManager.java