android--Focus

Source: Internet
Author: User

---restore content starts---

Baidu Cloud Test

In the development of the company generally print logs with the log class, usually encapsulated a logutils, through the switch to control the printing of log information.

/data/data:context.getfiledir (). GetPath ();
is an application's private directory, and only the current application has access to read and write, and other apps have no access. Some of the high security requirements of the data stored in the directory, generally used to store small size data.
/sdcard:enviroment.getexternalstoragedirectory (). GetPath ();
is an external storage directory that only uses the app to declare a permission for the <uses-permission android:name= "Android.permission.WRITE_EXTERNAL_STORAGE"/>, can access the read-write SDcard directory, so it is generally used to store some low-security data, file size is larger than the data.

Sharedpreferences is a data store that is made from an XML file. Generally used to store some of the marked data, some settings information.

Non-UI threads cannot update UI

Time-consuming operation (Networking URL) cannot be performed by the UI thread (possible connection timeout)

Handler message delivery, child thread--ui thread

MessageQueue Message Queuing messages received by the program

Handler Message Processor 1. Send Message-sendmessage () 2. Handling Messages-handlermessage ()

Looper polling Message Queuing, once a message arrives, forwards the message to the handler that sent the message for processing

Implicit intent to generally open the interface of the system application (Phone Dialer SMS sender, etc.)

Open your own interface.

life cycle of activity (must be mastered)the OnCreate method is called when the activity first startsthe OnDestroy method is called when the activity is destroyed.the Onstrat () method invokes when activity becomes visiblethe OnStop () method is called when activity is not visibleOnresume () method when activity can get focus when the button of the interface can be clickedThe OnPause () method is called when a button cannot be clicked when it loses focus.Onrestart () Called when the interface restartsToggle the life cycle of activity with the screen(1) in order to prevent changes in the life cycle of the screen switching, the activity is configured as followsandroid:screenorientation= "Portrait" (2) In order to declare that the cycle does not change

Android:configchanges= "Orientation|keyboardhidden|screensize"

---restore content ends---

android--Focus

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.