Skip to content

Commit

Permalink
Clear webviews before being re-used (#982)
Browse files Browse the repository at this point in the history
Webviews are recycled and need to be cleared before being re-used.
Otherwise the old webview content is shown until the new one is loaded.

Closes #948

Signed-off-by: mueller-ma <[email protected]>
  • Loading branch information
mueller-ma authored Sep 10, 2018
1 parent f7f230a commit 592f96d
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ public static class WebViewHolder extends ViewHolder {
@SuppressLint("SetJavaScriptEnabled")
@Override
public void bind(OpenHABWidget widget) {
mWebView.loadUrl("about:blank");
ViewGroup.LayoutParams lp = mWebView.getLayoutParams();
int desiredHeightPixels = widget.height() > 0
? widget.height() * mRowHeightPixels : ViewGroup.LayoutParams.WRAP_CONTENT;
Expand Down

0 comments on commit 592f96d

Please sign in to comment.