Added hint to the API documentation of "hasListener" and a corresponding code sample.