Getting values from addOnPreDrawListener()
<p>I have not understood how to return values from the method below, I have tried to return <code>int</code> but it shows me a weird error which is not possible to solve. This is the code: </p>

<pre><code>private void showTheEnemy() {

    ViewTreeObserver vto = radarImage.getViewTreeObserver();
    vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
        public boolean onPreDraw() {
            radarImage.getViewTreeObserver().removeOnPreDrawListener(this);
            yradar_height = radarImage.getMeasuredHeight();
            xradar_width = radarImage.getMeasuredWidth();
            return true;
        }
    });
    coordinateText.setText(yradar_height + " " + xradar_width);
}
</code></pre>

<p>I have understood that values are not being updated in the method because when I use <code>setText()</code> method then <code>int</code> values are 0.</p>