Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen is View.onMeasure() called?
    text
    copied!<p>When is</p> <pre><code>View.onMeasure(int widthMeasureSpec, int heightMeasureSpec) </code></pre> <p>called? I have an <a href="http://developer.android.com/reference/android/app/Activity.html" rel="nofollow noreferrer">Activity</a> that needs to perform an action after <a href="http://developer.android.com/reference/android/view/View.html#onMeasure%28int,%20int%29" rel="nofollow noreferrer">onMeasure</a> has been called.</p> <p>My question is the same as <a href="http://groups.google.com/group/android-developers/browse_thread/thread/1384d9333f4b5af1/fbc6a69a7ef5d918?show_docid=fbc6a69a7ef5d918&amp;pli=1" rel="nofollow noreferrer">the unanswered question posted here</a>. The <a href="http://developer.android.com/reference/android/view/View.html" rel="nofollow noreferrer">View</a> documentation states that <a href="http://developer.android.com/reference/android/view/View.html#onMeasure%28int,%20int%29" rel="nofollow noreferrer">onMeasure</a> is called when <a href="http://developer.android.com/reference/android/view/View.html#requestLayout%28%29" rel="nofollow noreferrer">requestLayout()</a> is called, which is apparently called by a view on itself when it believes that is can no longer fit within its current bounds.</p> <p>However, this doesn't tell me when my activity can assume that my <a href="http://developer.android.com/reference/android/view/View.html" rel="nofollow noreferrer">View</a> has been measured. I've used <a href="https://stackoverflow.com/questions/2537238/how-can-i-get-zoom-functionality-for-images">this code</a> to extend <a href="http://developer.android.com/reference/android/widget/ImageView.html" rel="nofollow noreferrer">ImageView</a> to form TouchImageView. <a href="https://stackoverflow.com/questions/6590031/how-do-i-find-the-width-height-of-imageview">It was suggested here</a> that I should use the <a href="http://developer.android.com/reference/android/view/View.html#onMeasure%28int,%20int%29" rel="nofollow noreferrer">onMeasure</a> method to scale my image. I wish to update the value of a <a href="http://developer.android.com/reference/android/widget/TextView.html" rel="nofollow noreferrer">TextView</a> after the <a href="http://developer.android.com/reference/android/widget/ImageView.html" rel="nofollow noreferrer">ImageView</a> has been measured in order to display the percentage by which the image has been scaled.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload