Add a simple onStateChanged() callback