Android: Width and Height of View After Orientation Change
Posted
by
David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2012-10-04T20:07:31Z
Indexed on
2012/10/04
21:38 UTC
Read the original article
Hit count: 245
I need to get the width and height of a WebView and pass them in the query string of the URL I am loading in the WebView. I have found a way to do this in onResume(). Since the width and height are not calculated at this point, I post a Runnable to the WebView to be queued for after the UI loads.
Here's my problem: when the orientation changes, I am handling it in onConfigurationChanged. When I try to post a Runnable in onConfigurationChanged to the WebView, the WebView's width and height end up being the old orientation's width and height. At what point can I intercept the new width and height after orientation change?
© Stack Overflow or respective owner