Wikipediaorgwikimodelviewcontroller comp 355 muppala

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: on- key listeners. COMP 4521 (Muppala) Android UI Overview 29 Event Listeners –  onTouch() •  This event can have mul7ple ac7ons that follow each other. So, if you return false when the down ac7on event is received, you indicate that you have not consumed the event and are also not interested in subsequent ac7ons from this event. Thus, you will not be called for any other ac7ons within the event, such as a finger gesture, or the eventual up ac7on event. •  Android will call event handlers first and then the appropriate default handlers from the class defini7on second. As such, returning true from these event listeners will stop the propaga7on of the event to other event listeners and will also block the callback to the default event handler in the View. So be certain that you want to terminate the event when you return true. COMP 4521 (Muppala) Android UI Overview 30 Event Handlers •  Android allows users to create their own custom view subclasses if the standard widgets are not sufficient. •  For custom view components created by users, events are handled using event handlers: –  onKeyDown(int, KeyEvent) - Call...
View Full Document

This document was uploaded on 03/12/2014.

Ask a homework question - tutors are online