How to hook the back key in android?

Hi all,

I find a problem in corona sdk, 

If I use java to write the apk for android, once user click the back key, the program will goto the previous page. But in Corona sdk, if user click the back key, the program will be closed.

I want to do the same thing in corona sdk program, once user click the back key, the program go to previous page.

Can I do this? 

Thank you all

Yes, it just depends on what you are using for your “pages”.   Are you using storyboard?

I am not using storyboard, I use director. If storyboard can do this ,I can convert to the storyboard.

Thank you JonPm, you give me lots of help.

It’s up to you how to handle this button. Default behaviour is to close app. If you want to change it, then then you must capture this event and process it. Search for Corona android hardware button handling

Thank you a lot, I now the direction to change it

Have a good day

Yes, it just depends on what you are using for your “pages”.   Are you using storyboard?

I am not using storyboard, I use director. If storyboard can do this ,I can convert to the storyboard.

Thank you JonPm, you give me lots of help.

It’s up to you how to handle this button. Default behaviour is to close app. If you want to change it, then then you must capture this event and process it. Search for Corona android hardware button handling

Thank you a lot, I now the direction to change it

Have a good day