Android constructor and Android Constructor

Source: Internet
Author: User

Android constructor and Android Constructor

This constructor is called when Java code creates a View instance or loads and constructs the interface based on the XML layout file.
1. onFinishInflate (): This is a callback method. When the application loads the component from the XML layout file and uses it to build the interface, this method will be called back.
2. onMeasure (int, int): Call this method to check the size of the View component and all its child components.
3. onLayout (boolean, int, int): This method is called back when the component needs to be assigned its sub-component location.
4. onSizeChanged (int, int): calls back this method when the size of the component is changed.
5. onDraw (Canvas): calls back this method when the component is about to draw its content.
6. onKeyDown (int, KeyEvent): This method is triggered when a key is pressed.
7. onKeyUp (int, KeyEvent): This method is triggered when a key is released.
8. onTrackballEvent (MotionEvent): This method is triggered when a trajectory event occurs.
9. onTouchEvent (MotionEvent): This method is triggered when a touch screen event occurs.
10. onWindowFocusChanged (boolean): This method is triggered when the component gets and loses focus.
11. onAttachedToWindow (): This method is triggered when the component is put into a window.
12. onDetachedFromWindow (): This method is triggered when the component is detached from a window.
13. onWindowVisibilityChanged (int): This method is triggered when the visibility of the window containing this component changes.

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.