Feature in Ranging beacons in Airport Demo app

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:

or from:

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.