Related questions
Question 135 - H14-231_V1.0 discussion
What events can the next piece of code handle?
A.
public class CustonLomponent extends Componentimplements Component.DrawTask,Component.EstimateSizeListener,Component.TouchEventListener { ...... public CustomComponent (Context context){ ... Set up a TouchEvent to respond to events setlouchEventListener(this); } ... @Override public boolean onTouchEvent(Component component,TouchEvent touchEvent){ switch (touchEvent.getAction() { case TouchEvent.PRIMARY_POINT_DOWN: circ1ePaint.setColor(Color.GREEN); invalidate() ; break; case TouchEvent.PRIMARY_POINT_UP: circlePaint.setColor(Color.YELLOWV); invalidate(); break ; } return false; } } Both DOWN and UP events can be handled normally
B.
Neither event can be processed
C.
can only handle DOWN events
D.
Only UP events can be processed
Your answer:
0 comments
Sorted by
Leave a comment first