Is the WebView getContentHeight() broken in 1.5/1.6?

by authoreyes » Thu, 22 Apr 2010 02:10:46 GMT


Sponsored Links
 All -

Urgent issue (and I see other people mentioned it with no resolution),
but how can I force getContentHeight() in the WebView to return an
accurate reading of the currently loaded content?

I have a WebView that needs to occasionally trim content (must display
on one page/no scrollbars).

I have it check the contentHeight onDraw, and it is too much, it trims
it, reloads it, and checks again.

Some times it works, but almost always not.  It always seems to report
the initial content height, as those it caches a value and won't
replace it (which looking at the WebView code, is what it seems to
do).  I can't find a way through the api though, to force it to
remeasure the html content height onDemand.

I am tearing my hair out here...Please anyone have any ideas?

--



Is the WebView getContentHeight() broken in 1.5/1.6?

by Maps.Huge.Info (Maps API Guru) » Thu, 22 Apr 2010 05:24:39 GMT


 You might try adding a bogus parameter to the end of the URL, such as
a random number or the time, like this:

url.htm?x=12345

That will most likely not bollix up the page and make the cache save
that as a unique page.

-John Coryat

"Radar Now!"

"What Zip Code?"

--


Sponsored Links


Is the WebView getContentHeight() broken in 1.5/1.6?

by authoreyes » Thu, 22 Apr 2010 05:32:57 GMT


 That is an interesting thought.....

Although I am using the loadData method with a string each
time....There is no actual url to speak of...I have tried clearing
cache/view/etc....

It's so odd...The view loads the right data, but the height reports
the original (even though the size is wildly different between loads)
for a few changes, then something causes it to re-eval, etc...

It's not consistent at all, and really annoying...if I can't depend on
this, I am not sure where to go with this current architecture....

On Apr 21, 4:24pm, "Maps.Huge.Info (Maps API Guru)"


>



Is the WebView getContentHeight() broken in 1.5/1.6?

by Maps.Huge.Info (Maps API Guru) » Thu, 22 Apr 2010 06:27:37 GMT


 You could also try switching to a method that saves the page to the
device and loads it as a URL instead of the direct method that you're
using now, that might get around the issue. Have you tried to test it
with a 2.0+ emulator? Still a problem?

-John Coryat

"Radar Now!"

"What Zip Code?"

--



Other Threads

1. android.util.SparseArray space time complexity properties

HashMap can indeed be faster than SparseArray. However, and this is
very important, SparseArray does not require boxing/unboxing of
primitive types which prevents allocations and thus prevents the GC to
stop your games for hundreds of milliseconds. That is much more
valuable :)






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~

2. lots of image to be textured on rotating cube opengl es

now i have lots of pictures to be textured on a Cube.there are four
faces to be textured:the front ,back ,left and right?when the cube
rotates 360 then load the next four picture and texture them.the
method above have a problem :the convertion of every four pictures is
not fluent think the multithread can work now ,but i am not familiar
with it .so can some body give me a example about it ?
€€
€IUI€--~--~---------~--~----~------------~-------~--~----~

3. When will ANdroid provide video phone function?

4. java.lang.VerifyError

5. Maintaining two Eclipse installs with two Android SDKs

6. Handling MAPS

7. findViewById returns NULL (RadioButton/RadioGroup)