Oracle JET Mobile Cordove Navigator.app objects

Source: Internet
Author: User

When developing WebApp with Oracle JET, the ojrouter is used, and the Ojrouter default contains the history push feature. When you debug Android, you will find that the return key is always returned to the last browsing record (the APP's record), which is unreasonable when used on the Android side.

Workaround:

1. The default history push feature is canceled when router is created. The document does not specify how to cancel, this method needs to be supplemented.

2. Call the Go method when using router, you can add the parameter go (' Stateid ', {historyupdate:skip}) to cancel the history push function when calling this method. But this only solves part of the problem, and it's not possible for each jump to be executed with go.

3. Change the return button to perform the task. Exit the app directly without returning the history.

1) Call Cordova to return button event handling. Document.addeventlistener ("Backbutton", Onbackkeydown, false);

2) Add the Onbackkeydown method. var onbackkeydown = function () {navigator.app.exitApp ();};

Here you can add two clicks to return before exiting the function.

Navigator.app object:

NAVIGATOR.APP.LOADURL () The application that loads the Web page or the system's default browser

NAVIGATOR.APP.CANAELLOADURL () cancel loading before the Web page loads successfully

Navigator.app.backHistory () returns to the previous browse page

Navigator.app.clearHistory () Empty browsing history

Navigator.app.clearCache () emptying the program's resource file cache

NAVIGATOR.APP.EXITAPP () Exit application

Navigator.app Object Reference site: http://tanglei528.blog.163.com/blog/static/43353399201401110738334/

  

Oracle JET Mobile Cordove Navigator.app objects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.