1. Event Listener class: Inner class, external class, Activity, anonymous inner class, directly bound to label
Focus on the use of direct binding to tags
For many of the Android interface component tags, they support onclick,onlongclick attributes such as the method name of a method like XXX (View source), which is a property value. A corresponding method is then defined in the activity of the interface layout, which handles the corresponding event on the control.
Most of the listener classes use anonymous internal classes
2. Callback mechanism
For the event-handling model of the callback, the event source and event listener are unified, or the event listener disappears completely, and when the user fires an event on the GUI component, the component's own specific method is responsible for handling the event, and we cannot add the method dynamically for an object, so we can only inherit the GUI component class. and override the event-handling method of the class to implement the
Callback-based event propagation: Almost all callback-based event-handling methods have a Boolean return value that identifies whether the processing method can handle the event fully, and if the return value is true, indicates that it has been fully processed and, if false, that it is not fully processed. This class of methods that can be propagated out and may call other components
3, Redraw
The OnDraw method of the replication view class can be called automatically by calling the View.invalidate method. OnDraw method
4. Responding to system-set events
Configuration class, the program can get the system configuration object through Getresouces (). GetConfiguration (), once the object is obtained, the object provides some common properties to get the configuration information of the system
Override onconfigurationchanged Response System settings Change
The callback method is called automatically when the system settings change//But, when actually used, this method does not call .... , don't know why
Activity.setrequestorientaiton (acitivityinfo.****); This method can change the direction of the phone settings, but to set up in Mainfest.xml, get permission
Android Miscellaneous Pen event handling