Exam AND-401 All QuestionsBrowse all questions from this exam
Question 102

Which of the following are layout-related methods called by the framework on views, and you can override them when customizing a view? (Choose two)

    Correct Answer: A, D

    onMeasure() and onSizeChanged() are both layout-related methods that can be overridden when customizing a view. The onMeasure() method is called during the layout pass to determine the size requirements for the view, whereas onSizeChanged() is called when the size of the view has changed. These methods allow the view to manage its layout configuration. On the contrary, onDraw() is related to rendering the view, and onKeyUp() is related to handling keyboard input, not layout customization.

Discussion
MmadiOptions: AD

A. onMeasure(). D. onSizeChanged().