Backbutton doesn't work at the beginning

Hi. I have a problem. When a run my app the backbutton doesn’t work but if I use an option that opens something external (ex: a pdf, a photoviewer) the backbutton works perfectly and executes the function very well:

onBackKeyDown: function($Event = window.event) {

Why is this happening?
Best regards