Android Question Blurry Text in Webview?

Status
Not open for further replies.

JohnC

Expert
Licensed User
Longtime User
Below is a screen shot of a weird issue I am running into on some devices.

Basically, I have an activity that a webview control takes up most of the screen. In code, I am programmically generating HTML code that I then display in the webview - so all of the text that the webview displays is from code, nothing from online.

The activity can be rotate, and I simply regenerate the same-exact HTML code for both orientations.

But, for some reason, when some of my users rotate the screen, the resulting text in the webview is all fuzzy and out of focus. And in most cases, the more times they switch orientations, the MORE blurrier the text gets.

What could possibly be causing the text to get blurry like this?

blurrytext.png
 

JohnC

Expert
Licensed User
Longtime User
Yes that worked....Wow - never would have thought it was that.

Thanks!
 
Last edited:
Upvote 0

Bryan

Member
Licensed User
Longtime User
Turning off hardware acceleration for one of my activities that uses WebView does not work with Android 4.4 Kitkat. I have these two lines in
my manifest.
SetActivityAttribute(Main, android:hardwareAccelerated, "true")
SetActivityAttribute(HtmlView, android:hardwareAccelerated, "false")

HtmlView is the one that has blurred text with webview when the device is rotated. Once rotated it never goes back to normal. I'm only using the Webview for printing the contents of a *.csv file. Maybe I should just hide Webview completely and just do the printing without giving the user a preview of what's being printed. Webview works correctly on my Android 5 device. Anyone have any suggestions? Thanks
 
Upvote 0

Bryan

Member
Licensed User
Longtime User
So, others may know the problem with webview being blurry with Android 4.4 KitKat on my tablet I found was caused by the animation setting in designer. It had nothing to do with Hardware acceleration being on for that activity. Simply just setting animation duration for webview to 0 fixed the problem. This isn't mentioned anywhere that I can find searching here or elsewhere. I think this was my last major issue I had with my project and getting closer to getting it released. Could this be a bug?
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Do you mean set the animation duration of the parent "activity" (hosting the webview control)? I ask because I don't see a "Animation Duration" property for the webview control.
 
Upvote 0

Bryan

Member
Licensed User
Longtime User
Yes, sorry it is the parent activity (animation duration) that hosts a webview that was causing the problem.
 
Upvote 0

alain bertrand

Member
Licensed User
Longtime User
Android 4.4.4
Setting the animation duration of the webview's parent to 0 doesn't solve my blurry problem.
Turning off hardware acceleration does.
Thanks.
 
Upvote 0
Status
Not open for further replies.
Top