Apansmiley
Apansmiley

Reputation: 23

Using the android backbutton with Dojomobile and phonegap in worklight

Im creating an app (rather big one) with Worklight. When im testing the app in an android phone and press the backbutton it closes the app.. now i want it to go back one page. Right now the page navigation is with dojox mobile implemented system. this way:

<button data-dojo-type="dojox.mobile.ToolBarButton" data-dojo-props="transition:'fade',dir:'1',moveTo:'Contact'" class="buttonHem" style="color:black; font-size:1em;">Kontakta Oss</button>

is there a way to use the android backbutton without having to redo everything?

we have deadline in 2 weeks so there is really no time to redo the app with jquery mobile..

Answers will be appreciated.

Upvotes: 2

Views: 919

Answers (2)

Anton
Anton

Reputation: 3166

If you're talking about a hardware Android back button you have a WL API to override it's behaviour. WL.App.overrideBackButton(function() { doSomething }); and WL.App.resetBackButton();

Upvotes: 2

Nick Roth
Nick Roth

Reputation: 3077

The back button functionality should work in Dojo Mobile. Looking at the documentation for ToolBarButton I think what you need to do is use a # in front of your next view for the moveTo attribute. In your example it would be moveTo:'#Contact' Take a look at the moveTo attribute in the doc below for more info.

http://dojotoolkit.org/reference-guide/1.8/dojox/mobile/ToolBarButton.html

Upvotes: 2

Related Questions