From f90178d08d3a6cdb500a6f4d1069c38036b3db69 Mon Sep 17 00:00:00 2001
From: Scott Main
onTouchEvent() method is called on that object. However, in order to intercept this, you must extend
-the class and override the method. Obviously, extending every View object
-you want to use (just to handle an event) would be obsurd. This is why the View class also contains
+the class and override the method. However, extending every View object
+in order to handle such an event would not be practical. This is why the View class also contains
a collection of nested interfaces with callbacks that you can much more easily define. These interfaces,
called event listeners, are your ticket to capturing the user interaction with your UI.
You may also find it more conventient to implement OnClickListener as a part of your Activity. +
You may also find it more convenient to implement OnClickListener as a part of your Activity. This will avoid the extra class load and object allocation. For example:
public class ExampleActivity extends Activity implements OnClickListener {
@@ -168,7 +168,7 @@ you'll learn see some of the common callbacks used for event handling, including
{@link android.view.View#onTouchEvent} - Called when a touch screen motion event occurs.{@link android.view.View#onFocusChanged} - Called when the view gains or loses focus.There are some other methods that you should be awere of, which are not part of the View class, +
There are some other methods that you should be aware of, which are not part of the View class, but can directly impact the way you're able to handle events. So, when managing more complex events inside a layout, consider these other methods: