ExamGecko
Question list
Search
Search

Related questions











Question 135 - H14-231_V1.0 discussion

Report
Export

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
Answers
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
Answers
B.
Neither event can be processed
C.
can only handle DOWN events
Answers
C.
can only handle DOWN events
D.
Only UP events can be processed
Answers
D.
Only UP events can be processed
Suggested answer: A
asked 18/09/2024
Khaled Fouad
33 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first