Comp 4521 muppala android ui overview 30 event

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: key or presses and holds down on the trackball (for one second). •  onFocusChange() –  From View.OnFocusChangeListener. This is called when the user navigates onto or away from the item, using the naviga7on- keys or trackball. COMP 4521 (Muppala) Android UI Overview 26 Event Listeners •  onKey() –  From View.OnKeyListener. This is called when the user is focused on the item and presses or releases a key on the device. •  onTouch() –  From View.OnTouchListener. This is called when the user performs an ac7on qualified as a touch event, including a press, a release, or any movement gesture on the screen (within the bounds of the item). •  onCreateContextMenu() –  From View.OnCreateContextMenuListener. This is called when a Context Menu is being built (as the result of a sustained "long click"). See the discussion on context menus in Crea7ng Menus for more informa7on. COMP 4521 (Muppala) Android UI Overview 27 Event Listeners Example public class ExampleAc7vity extends Ac7vity implements OnClickListener { protected void onCreate(Bundle savedValues) { ... Bu8on bu8on = (Bu8on)findViewByI...
View Full Document

Ask a homework question - tutors are online