Skip to content
Snippets Groups Projects
Unverified Commit 592f96d7 authored by mueller-ma's avatar mueller-ma Committed by GitHub
Browse files

Clear webviews before being re-used (#982)


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: default avatarmueller-ma <mueller-ma@users.noreply.github.com>
parent f7f230aa
Branches
Tags
No related merge requests found
...@@ -970,6 +970,7 @@ public class OpenHABWidgetAdapter extends RecyclerView.Adapter<OpenHABWidgetAdap ...@@ -970,6 +970,7 @@ public class OpenHABWidgetAdapter extends RecyclerView.Adapter<OpenHABWidgetAdap
@SuppressLint("SetJavaScriptEnabled") @SuppressLint("SetJavaScriptEnabled")
@Override @Override
public void bind(OpenHABWidget widget) { public void bind(OpenHABWidget widget) {
mWebView.loadUrl("about:blank");
ViewGroup.LayoutParams lp = mWebView.getLayoutParams(); ViewGroup.LayoutParams lp = mWebView.getLayoutParams();
int desiredHeightPixels = widget.height() > 0 int desiredHeightPixels = widget.height() > 0
? widget.height() * mRowHeightPixels : ViewGroup.LayoutParams.WRAP_CONTENT; ? widget.height() * mRowHeightPixels : ViewGroup.LayoutParams.WRAP_CONTENT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment