Status Update
Comments
ga...@gmail.com <ga...@gmail.com> #2
I am having the same problem. Whenever a new page is requested and rendered, a first white background shows briefly and causes flickering. Very unpleasant visual effect. Only happens when hardware acceleration is enabled.
ev...@gmail.com <ev...@gmail.com> #3
pls, tell me if you find any workaround for this (except for turning off HW acceleration)
Currently I don't know if this is possible
Currently I don't know if this is possible
ro...@android.com <ro...@android.com>
ga...@gmail.com <ga...@gmail.com> #4
No workaround so far yet. Even the stock browser of Galaxy Nexus (LTE) suffers the same problem.This is especially bad for black background websites. However, Chrome beta is fine (apparently not using stock WebView?)
mi...@gmail.com <mi...@gmail.com> #5
Same problem on ASUS Transformer Prime TF201 (Android 4.0.3).
When we can expect some fixes here?
When we can expect some fixes here?
[Deleted User] <[Deleted User]> #6
Expecting for the fix/workaround.. Very annoying. And browsing with disabled hardware acceleration is really horrible user experience. Google Please Fix!
ev...@gmail.com <ev...@gmail.com> #7
Did a workaround for this.
I added a view to my WebView, so this view is on top of the content. View has needed background color
Then, after some timeout I hide fake workaround view.
It's ugly, but works
I added a view to my WebView, so this view is on top of the content. View has needed background color
Then, after some timeout I hide fake workaround view.
It's ugly, but works
ka...@gmail.com <ka...@gmail.com> #8
Can you share the code snippet for the workaround? How do you switch from fake view to the correct view. Will it causes unnecessary latency.
ev...@gmail.com <ev...@gmail.com> #9
Here is what I did:
1. added workaround LinearLayout view to the WebView (WebView wv)
workaround = new LinearLayout(context);
workaround.setBackgroundColor(color);
wv.addView(workaround, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
2. when I load any url I make it visible (also, note some variables: hidingWorkaround is boolean. handler is just android Handler)
workaround.setVisibility(View.VISIBLE);
handler.removeCallbacks(hideWorkaround);
hidingWorkaround = false;
3. when I get information about progress (in WebChromeClient) I initiate hiding progress:
if(isVisible() && !hidingWorkaround && workaround.getVisibility() != INVISIBLE) {
hidingWorkaround = true;
handler.postDelayed(hideWorkaround, 800);
}
where hideworkaround is runnable:
{
workaround.setVisibility(View.INVISIBLE);
hidingWorkaround = false;
}
That's all
Also, notice, this should be done only in ICS. so you have to check Android Version
1. added workaround LinearLayout view to the WebView (WebView wv)
workaround = new LinearLayout(context);
workaround.setBackgroundColor(color);
wv.addView(workaround, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
2. when I load any url I make it visible (also, note some variables: hidingWorkaround is boolean. handler is just android Handler)
workaround.setVisibility(View.VISIBLE);
handler.removeCallbacks(hideWorkaround);
hidingWorkaround = false;
3. when I get information about progress (in WebChromeClient) I initiate hiding progress:
if(isVisible() && !hidingWorkaround && workaround.getVisibility() != INVISIBLE) {
hidingWorkaround = true;
handler.postDelayed(hideWorkaround, 800);
}
where hideworkaround is runnable:
{
workaround.setVisibility(View.INVISIBLE);
hidingWorkaround = false;
}
That's all
Also, notice, this should be done only in ICS. so you have to check Android Version
cc...@android.com <cc...@android.com> #10
Unfortunately, the only way to workaround the issue is to do something like the above, hiding the WebView during transitions. In ICS, a hardware accelerated WebView clears the frame buffer with white if it has content that hasn't finished rendering into tiles yet.
Thanks for the simple test case.
Thanks for the simple test case.
cc...@android.com <cc...@android.com> #13
Fixed in JB
dr...@gmail.com <dr...@gmail.com> #14
I am facing the same issue on JB. Web view still blinks for the time I accelerate.
Device : Galaxy Nexus.
Device : Galaxy Nexus.
mi...@niskala.org <mi...@niskala.org> #15
This does not appear to be fixed in jelly bean. Please re-open.
vn...@gmail.com <vn...@gmail.com> #16
I'm getting the same issue on JB 4.1.1.
an...@gmail.com <an...@gmail.com> #17
[Comment deleted]
an...@gmail.com <an...@gmail.com> #18
Could the Priority of this bug be set at least to High (and the bug be re-opened) ?
Because this bug makes almost impossible for HTML5 designer to create a decent app on all Android 4.x devices, either the HW acceleration should be set to OFF (i.e. video not working though html5 video tag, slow CSS etc), either flickering occurs.
Many people are just opening a Webview and makes their app in HTML5/JS, so the impacted people must be huge.
Because this bug makes almost impossible for HTML5 designer to create a decent app on all Android 4.x devices, either the HW acceleration should be set to OFF (i.e. video not working though html5 video tag, slow CSS etc), either flickering occurs.
Many people are just opening a Webview and makes their app in HTML5/JS, so the impacted people must be huge.
cc...@android.com <cc...@android.com> #19
Does the issue that you're seeing only happen when launching the app for the first time, or is it every time you're navigating to new content?
The fix that was released in JB should have covered the flicker when transitioning between content with non-white backgrounds.
If the problem is occurring when launching an app for the first time, you'll have to also account for the way initial app rendering works. When an app is started fresh (i.e. not previously running/cached), the launched activity itself appears to animate to fill the screen. In reality, a placeholder generated from the activity's style is shown during this animation.
Even if a WebView has a black background or your window has a background drawable, the preview will draw using the style's 'colorBackground' value. For the default style for SDK 15 (which I was targeting in my configuration) that color is white. This leads to a white space in place of the full-screen WebView animating on screen, until correct rendering occurs.
Instead, try adding a dark theme to your <activity> in the AndroidManifest.xml, e.g. :
android:theme="@android:style/Theme.Black"
Note: you'll probably want may want to create your own style, inheriting from the normal style you're using, and just override the 'colorBackground' attribute. This is especially useful if your background isn't black. See:http://developer.android.com/guide/topics/ui/themes.html
The fix that was released in JB should have covered the flicker when transitioning between content with non-white backgrounds.
If the problem is occurring when launching an app for the first time, you'll have to also account for the way initial app rendering works. When an app is started fresh (i.e. not previously running/cached), the launched activity itself appears to animate to fill the screen. In reality, a placeholder generated from the activity's style is shown during this animation.
Even if a WebView has a black background or your window has a background drawable, the preview will draw using the style's 'colorBackground' value. For the default style for SDK 15 (which I was targeting in my configuration) that color is white. This leads to a white space in place of the full-screen WebView animating on screen, until correct rendering occurs.
Instead, try adding a dark theme to your <activity> in the AndroidManifest.xml, e.g. :
android:theme="@android:style/Theme.Black"
Note: you'll probably want may want to create your own style, inheriting from the normal style you're using, and just override the 'colorBackground' attribute. This is especially useful if your background isn't black. See:
vn...@gmail.com <vn...@gmail.com> #20
Here, every time that i navigate to a new content, it blinks white. Only when HW is enabled.
fl...@googlemail.com <fl...@googlemail.com> #21
[Comment deleted]
[Deleted User] <[Deleted User]> #22
It is same on JB but if you set the backgroundColor(Color.argb(1, 0, 0, 0,)); it does not flicker anymore
[Deleted User] <[Deleted User]> #23
Im surprised that this is an issue at all... on iPhone webviews this has never been an issue... scrolling is super smooth, just like the transitions.
Here it seems like its either smooth scrolling with flashes or no flashes with slow scrolling...
Here it seems like its either smooth scrolling with flashes or no flashes with slow scrolling...
as...@gmail.com <as...@gmail.com> #24
I have the same issue...I think it is high priority issue...
va...@gmail.com <va...@gmail.com> #25
Same issue on Nexus 7 (4.2.2)
vn...@gmail.com <vn...@gmail.com> #26
So, any news about this bug ?
[Deleted User] <[Deleted User]> #27
I am facing this issue even when android:hardwareAccelerated="false"
Device: Motorola Xoom (4.1.2)
Device: Motorola Xoom (4.1.2)
an...@gmail.com <an...@gmail.com> #28
Try to set android:targetSdkVersion="11"
[Deleted User] <[Deleted User]> #29
Thanks Anthony for the prompt reply.
But changing the targetSdkVersion to 11 did not help.
Below are the uses-sdk and application tag from my application manifest.
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="11" />
<application
android:hardwareAccelerated="false"
android:icon="@drawable/xyz_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@android:style/Theme.NoTitleBar" >
Is there something else that needs to be done?
But changing the targetSdkVersion to 11 did not help.
Below are the uses-sdk and application tag from my application manifest.
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="11" />
<application
android:hardwareAccelerated="false"
android:icon="@drawable/xyz_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@android:style/Theme.NoTitleBar" >
Is there something else that needs to be done?
an...@gmail.com <an...@gmail.com> #30
Try to set minSdkVersion to 11 too
[Deleted User] <[Deleted User]> #31
Tried that too. Did not help :(
si...@gmail.com <si...@gmail.com> #32
I'm getting the same issue on 4.2.2 disable hardware acceleration fix this Problem
[Deleted User] <[Deleted User]> #33
We also turned off hardware acceleration; it fixed the white screen issue, but now we have issues playing videos from websites.
Does anybody else observe the same?
Does anybody else observe the same?
[Deleted User] <[Deleted User]> #34
android:hardwareAccelerated="false" works for me
[Deleted User] <[Deleted User]> #35
This issue is causing us to halt and switch to targeting iPhone. Quite sad it's still an issue in jb.
ni...@gmail.com <ni...@gmail.com> #36
android:hardwareAccelerated="false" works, but it still has white blink first time it loads url.
when i change the content of webview next time it wont blink.
when i change the content of webview next time it wont blink.
se...@gmail.com <se...@gmail.com> #37
Does anyone have the Jelly Bean patch?
ig...@caretronic.com <ig...@caretronic.com> #39
same issue.
android:hardwareAccelerated="false" works.
android:hardwareAccelerated="false" works.
so...@gmail.com <so...@gmail.com> #40
I´m having flickering in 4.4.4 (Nexus 5). BackgroundColor(Color.argb(1, 0, 0, 0,)) fixs the flickering..
ha...@gmail.com <ha...@gmail.com> #41
Still existed on KitKat (Sony Xperia M2).
ga...@gmail.com <ga...@gmail.com> #42
Issue still exists on android 4.4.4 with HA turned off...
gl...@gmail.com <gl...@gmail.com> #43
Why is this issue closed? Still present for 4.42 at least.
hardware acceleration off
hardware acceleration off
gl...@gmail.com <gl...@gmail.com> #44
In my case I had a webview in a number of fragments that got inflated on menu clicks.
Just like the "planets" example but using webview instead on Images.
I think the problem shows when calling loadUrl after a fragment is inflated or created.
I changed my code to have one fragment with one webview and I reuse that. I set the first loadUrl in onPostCreate for my activity. The flicker problem is gone now.
Just like the "planets" example but using webview instead on Images.
I think the problem shows when calling loadUrl after a fragment is inflated or created.
I changed my code to have one fragment with one webview and I reuse that. I set the first loadUrl in onPostCreate for my activity. The flicker problem is gone now.
qx...@gmail.com <qx...@gmail.com> #45
Issue still exists on android 5.1.1 with HA turned on...
cp...@gmail.com <cp...@gmail.com> #46
Issue still exists on android 5.1.1 with HA turned on...
ma...@imatt.us <ma...@imatt.us> #47
Issue still exists on android 6.0.1 with HA turned on. Disabling HA removes the flash.
da...@sonymobile.com <da...@sonymobile.com> #48
I fixed issue like this by using a hardware layer for the WebView. This ensures that the WebView is rendered to an off-screen buffer before shown on screen.
mWebView.setLayerType(View.LAYER_TYPE_HARDWARE, new Paint());
mWebView.setLayerType(View.LAYER_TYPE_HARDWARE, new Paint());
[Deleted User] <[Deleted User]> #49
[Comment deleted]
[Deleted User] <[Deleted User]> #50
The flickering issue still exists in Android 7.0. Disabling HA fixes this issue, but this is not an option because of poor performance.
Also setting the layer type to View.LAYER_TYPE_HARDWARE does not fix this issue.
What do we do:
We are showing a live camera feed in a WebView. All Images are fetched nativaly via a Cordova Plugin (Because its an Cordova application). The Images are then handed over to Javascript to display them in the WebView. Every once in a while the WebView flickers.
Whats the status of this bug entry?
Exact configuration:
Model Number: Nexus 6
Android Version: 7.0
Android Security patch level: October 5, 2016
Build number: NBD90Z
Also setting the layer type to View.LAYER_TYPE_HARDWARE does not fix this issue.
What do we do:
We are showing a live camera feed in a WebView. All Images are fetched nativaly via a Cordova Plugin (Because its an Cordova application). The Images are then handed over to Javascript to display them in the WebView. Every once in a while the WebView flickers.
Whats the status of this bug entry?
Exact configuration:
Model Number: Nexus 6
Android Version: 7.0
Android Security patch level: October 5, 2016
Build number: NBD90Z
[Deleted User] <[Deleted User]>
au...@gmail.com <au...@gmail.com> #51
May 2020, Android 10, and issue hasn't been fixed.
cl...@gmail.com <cl...@gmail.com> #52
This issue still in android 7.0 on LENOVO TB-7307I. When displaying some HTML GAMES on WEBVIEW.
Also I tried to set the layer type to View.LAYER_TYPE_HARDWARE and problem still exists.
Any Suggestions to fix this ?
Also I tried to set the layer type to View.LAYER_TYPE_HARDWARE and problem still exists.
Any Suggestions to fix this ?
Description
You can find simple project in attachment. It was working ok in all pre-ICS releases.
Also, previously I used setBackgroundColor to set color to black. Now this doesn't help. When I call loadDataWithBaseURL method background turns white for some time and then turns black (as it should).
This happens on all ICS devices I can test.
And never happens on any other device (including Honeycomb)
Also, this never happens when I disable hardware acceleration for WebView (but this is not very good, cause performance is much better with HW accel enabled)
Here is the code from my project
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView wv = (WebView) findViewById(R.id.wv);
wv.setBackgroundColor(Color.BLACK);
wv.loadDataWithBaseURL(
"about:blank",
"<html><body style='background: black; color: white'>This is test</body></html>",
"text/html", "UTF-8", "about:blank"
);
}
Thanks!