How do I ensure that the IME show/hide results in a call to View.onSizeChanged()
<p>I have a <code>View</code> implementation whose parent layout is a <code>ScrollView</code>.  I would like to be called back when the IME is shown/hidden so that I can resize the <code>View</code> accordingly.  I understand that <code>onSizeChanged()</code> should be called each time the IME is shown or hidden, but in my code this is not happening.</p>

<p>I've written a test application in order to get the functionality I'm after, and it contains:</p>

<ul>
<li>A <code>Button</code> to toggle the IME (show/hide).</li>
<li>A <code>ScrollView</code> containing several <code>TextView</code>s.</li>
</ul>

<p>When I click on the button (in this test app), then the IME is shown and the <code>ScrollView</code> is resized accordingly.  This is the behaviour I want.  I note that in the test app, the <code>ScrollView</code>'s <code>onSizeChanged()</code> gets called by the framework requesting a layout, and then an <code>invalidate()</code> to redraw
the screen.  This behaviour is missing in my incorrectly-functioning application; there is no call to the <code>ScrollView</code>'s <code>onSizeChanged()</code> or to my implemented <code>View</code>'s <code>onSizeChanged()</code>.</p>

<p>My manifest contains the <code>android:windowSoftInputMode="adjustResize"</code> attribute, and I've also added <code>isScrollContainer="true"</code> to the <code>ScrollView</code>'s attribute in the layout xml, but this doesn't appear to make any difference.</p>

<p>Could someone please suggest what it is that I could look at in order to get the <code>onSizeChanged()</code> callback in my <code>View</code>?</p>

<hr>

<p>Note: This is essentially a cross-post of the following on the Android-Developers group:</p>

<p><a href="http://groups.google.com/group/android-developers/t/fa84d7cb450c7f5e" rel="nofollow">http://groups.google.com/group/android-developers/t/fa84d7cb450c7f5e</a></p>

<p>Apologies if this offends anyone, but by posting here (with appropriate tags) I believe that the android team will see it and hopefully provide some assistance.</p>
