Reference:
-
Code is from offical blog post: https://coronalabs.com/blog/2015/05/05/tutorial-the-finalize-api-an-unsung-hero/
-
Function and Table Listeners : https://docs.coronalabs.com/guide/events/detectEvents/index.html#function-and-table-listeners