Storyboard GoToScene Doesn't Work Properly With "Back" Button On Android

sorry guys but i dont know how to put it in system wide handler in main.lua. yeah i have created that deviceKeys.lua and created the global function in main.lua:

deviceKeys = require "deviceKeys" 

but then what? What should I put in scene1/scene2/scene3 after this? Because as of now the “back” button just functioning like the original (when you press back, it just quit the app).

update: ok guys, it works! i just put the codes in main.lua so i dont need to create another lua file just for that.

now the only problem is just about the getPrevious() function that will bounce around like mentioned in that article: http://coronalabs.com/blog/2013/03/26/androidizing-your-mobile-app/

will read that one now. Thanks!

To sum up the bouncing between scenes issue.  .getPrevious() is not a history of previously visited scenes like say the back button in a web browser.  It literally is “get me the last scene that was shown”.   If you use it to back up a scene, then the previous scene was the original scene and you get in this loop of just cycling between the two scenes.

Rob