Stavros
Posts: 0
Joined: Wed Nov 14, 2012 1:34 pm

Program the back button on mobile phone?

How can I prevent the application from going back to the previous screen when the user pushes the "back" button on his/her Android device?
How can I direct him/her to the startscreen?

Thank you

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Program the back button on mobile phone?

Hello! You should add JS handler to navigate to Startscreen when Backbutton is pressed. This should help http://docs.phonegap.com/en/2.2.0/cor... (see backbutton event)

Stavros
Posts: 0
Joined: Wed Nov 14, 2012 1:34 pm

Program the back button on mobile phone?

Thank you Marina,

Because I am a novice Tiggzi user,...
Where should I put the script

document.addEventListener("backbutton", onBackKeyDown, false);

function onBackKeyDown() {
// Handle the back button
???
}

Startscreen lets say is my target page,

Thanks again

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Program the back button on mobile phone?

Try to create Custom JS and enter the next code

document.addEventListener("backbutton", onBackKeyDown, false);

function onBackKeyDown() {
Tiggzi.navigateTo('Startscreen');
}

Stavros
Posts: 0
Joined: Wed Nov 14, 2012 1:34 pm

Program the back button on mobile phone?

Thank you very much!
(sorry for the delayed answer)

Return to “Issues”