Android Application Development (AND-401) — Question 83
Method onDraw() of class android.view.View has the following signature:
Answer options
- A. public void onDraw(Color)
- B. public void onDraw(Canvas)
- C. public boolean onDraw(Canvas)
- D. public Canvas onDraw()
Correct answer: B
Explanation
The correct signature for the onDraw() method is public void onDraw(Canvas), which allows the method to receive a Canvas object to draw on. The other options are incorrect because they either use the wrong parameter type, such as Color, or have incorrect return types.