Mobile App page WebView mode jump detailed

Source: Internet
Author: User

First, take a look at the difference between the Android home key and the back key

Back Key

Android programs do not have to deliberately quit, when you press the back of the phone, the system will default to call the top activity in the program stack Destroy () method to destroy the current activity. When this activity is started again by other activity, the OnCreate () method is called again to create, and when all activity in the stack pops up, the application ends. If there is a service in the program, It is possible to listen to the processing in the right place.

Home Key

Android program is hidden, when you press the phone's home button, the system will default to call the top activity in the program stack Stop () method, and then the entire application will be hidden, when you click on the Phone Desktop app icon again, The system invokes the Onresume () method of the topmost activity, which does not reopen the program, but directly enters, showing the topmost activity in the stack.

The back key defaults to the current activity to the Finish,home key only to the activity to OnStop.

Mobile App Page Jump implementation method (not native, nor spa, using WebView mode):

Each webview can be understood as a browser, or a browser tab (a browser tab is actually a browser, but is integrated into a browser for easy switching)

Jump between the mobile can open a new webview, you can also jump on the page (in the same WebView push page), just like the PC side. Android back Key Press, the first to determine whether this webview fallback can be achieved, if true, then fallback, until false can not be back, will be the WebView page to pop, that is, to close the webview.

Mobile App page WebView mode jump detailed

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.