When ever I make a css class change, the changes don\'t always appear. This appears to happen when I have a touch event that adds something like a down class name to a butto
As pointed out above and elsewhere - overriding View.onDraw()
and calling View.invalidate
will make for an unhappy battery / app performance will drop. You can also do a manual invalidate
call ever x ms like so
/**
* Due to bug in 4.2.2 sometimes the webView will not draw its contents after the data has loaded.
* Triggers redraw. Does not work in webView's onPageFinished callback for some reason
*/
private void forceWebViewRedraw()
{
mWebView.post(new Runnable() {
@Override
public void run()
{
mWebView.invalidate();
if(!isFinishing())
mWebView.postDelayed(this, 1000);
}
});
}
I tried putting an invalidate call in WebViewClient.onPageLoaded()
but this does not seem to work. While my solution could be better its simple and it works for me (im just showing a twitter login)