Хммм. Я просмотрел источник WevView и вижу, что внутри они используют View # getWidth и View # getHeight. Вот один из частных методов WebView
:
/*
* Return the width of the view where the content of WebView should render
* to.
*/
private int getViewWidth() {
if (!isVerticalScrollBarEnabled() || mOverlayVerticalScrollbar) {
return getWidth();
} else {
return getWidth() - getVerticalScrollbarWidth();
}
}
Как отмечается в комментариях, вы должны убедиться, что измеряете его после того, как назначите макет деятельности, например. setContentView(R.layout.mylayout);