3rd Question of Android basic related face

Source: Internet
Author: User

1, activity issues explained

  A) activity's life cycle

4 states of 1.Activity

Running/paused/stopped/killed

Running:activity is active, the user can click on the screen, the screen responds, the activity is at the top of the stack

Paused:activity loses focus, user can not click, or be occupied by a non-full-screen activity, transparent interface into the top of the stack

Stopped: When the activity is fully covered

Killed: Recovered by Android system

Life cycle of 2.Activity

      Activity start->oncreate ()->onstart ()->onreasume ()

Click the Home button to return to the main interface (activity not visible)->onpause ()->onstop ()

When we return to the original activity->onrestart ()->onstart ()->onreasume ()

Exit Current Activity->onpause ()->onstop ()->ondestroy ()

3.Android Process Priority

Foreground process: Activity that is in the foreground and user interaction or service bound to the foreground activity
Visible process: In foreground but user cannot click
Service process: Start a service in the background
Background process: The foreground process clicks the hone key and becomes the background process
Empty process: Not part of the previous four processes, Android system can be killed at any time

b) Android's task stack

      

c) activity start mode

Standard mode: Default startup mode
Singletop Stack top multiplexing mode: When the activity that needs to be created is already at the top of the stack, the activity at the top of the stack is directly reused. No new activity will be created, and if the activity that needs to be created is not on top of the stack, a new activity stack is created again, as in standard mode
Singletask in-Stack reuse mode: If the activity that needs to be created is already in the stack, no new activity is created at this time, but the other activity above the activity that exists on the stack is destroyed, making it the top of the stack.
SingleInstance Single Instance mode: SingleInstance is special, is a global singleton mode, is a strengthened singletask mode. In addition to having all of its features, it reinforces the point that an activity with this pattern can only be on a single task stack.

d) Scheme Jump protocol

The scheme in Android is an intra-page jump protocol that allows you to jump to any page in the app by customizing the Scheme protocol.

Server can customize the Jump app page
App can jump to another app page via scheme
You can jump to the app native page via the H5 page
Protocol format
Uri.parse ("Qh://test:8080/goods?goodsid=8897&name=fuck")
QH represents the scheme protocol name
Test represents the Address field of scheme function
8080 represents the port number of the change path
/goods represents the specified page (path)
Goodsid and name represent the two parameters passed

Scheme use

http://blog.csdn.net/lishuiyuntian/article/details/77477756

2, Fragment problem explanation

 A) Why fragment is called the fifth largest component

b) Two ways to load the fragment into the activity

1. Static loading

XML mode

2. Dynamic loading

Fragmentmanager Fragmentmanager = Getfragmentmanager ();        Fragmenttransaction fragmenttransaction = Fragmentmanager.begintransaction ();        Fragmenttransaction.add (R.id.collapseactionview,new Fragment ());        Fragmenttransaction.commit ();

c) difference between Fragmentpageadapter and Fragmentstatepageadapter
Fragmentpageadapter for low-interface situations
Fragmentstatepageadapter is suitable for many interfaces
See the source of the Destroyitem function found fragmentstatepageadapter in the ViewPage switch interface when the real memory is recycled, and fragmentpageadapter will not

D) The life cycle of the fragment

      

e) communication between the Fragement

1.Fragemnt calling methods in activity

      

2.Activity calling methods in fragment

3.Fragment calling methods in fragment

3, Service questions explained

4, broadcast problem explanation

5, WebView security vulnerability problem explanation

6, Binder problems explained

3rd Question of Android basic related face

Related Article

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.