Various events in the development of Android

Source: Internet
Author: User

OnClick (View v) An ordinary click button event

The boolean onkeymultiple (int keycode,int repeatcount,keyevent event) is used to occur when multiple events are continuous, for key repetition, and @override implementations must be overloaded

Boolean onKeyDown (int keycode,keyevent event) to occur when the key is pressed

Boolean onKeyUp (int keycode,keyevent event) to occur when a key is released

Ontouchevent (motionevent Event) touch-screen events that occur when there is an action on the touchscreen

Boolean onkeylongpress (int keycode, keyevent event) When you're on time

Boolean ontrackballevent (Motionevent event):

  Parameter event: The parameter event is the object of the mobile Trackball event encapsulation class, which encapsulates the details of the triggering event, including the type of event, the trigger time, and so on, in general, the object is created when the user manipulates the trackball.
Return value: The return value of the method is exactly the same as the return value mechanism for each callback method described earlier, because the book is limited in length and is not covered.
The difference between the trackball and the phone keypad is shown below.
Some models of mobile phone design of the trackball will be more beautiful than the only phone keyboard, can add users to the overall impression of the phone.
Trackball is easier to use, such as using Trackball control in some games.
The use of trackball is more granular than the keyboard, that is, when scrolling the trackball, the value of the representation state of the background will change more subtle, more accurate.
The method is basically the same as the various callback methods described earlier, can be overridden in the activity, or overridden in the implementation class of each view.
Tip: In the emulator running state, you can open the simulator's trackball through the F6 key, and then you can simulate the Trackball event by moving the mouse.

Various events in the development of Android

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.