Clean up MainActivity by upgrading anonymous listener.