Search code examples
androiduser-interfaceandroid-viewonmeasure

Where is the onMeasure() default code located?


I understand that you can override the onMeasure() method to make custom measurements and that the onMeasure() method is called when you call the view.measure() method

If I call view.measure as shown below, it will still work even if I don't override the onMeasure method? That means there is a default version of the onMeasure method that exists, where is it located?

i don't exactly know what is going on when the measure method is called on a View object, the documentation does not tell much about this. is if i am not overriding the onMeasure() method i have to look at the code for the already defined onMeasure() method to find out what it is doing. the scary part is calling measure and not knowing what is going on under the hood.

I want to see it and can't find the code

 view.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),

Solution

  • check the AOSP for the codes view.onmeasure view.onmeasure