I'm trying to apply expand collapse feature on Webview Based on its Content height but i'm always getting wrong value
Here is my code
public class MesuredHeightWebView extends WebView {
public MesuredHeightWebView(Context context) {
super(context);
}
public MesuredHeightWebView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MesuredHeightWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public void invalidate() {
super.invalidate();
if (getContentHeight() > 0) {
// WebView has displayed some content and is scrollable.
if(listener!=null)
listener.updateContentHeight(getContentHeight());
}