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. clear issue on Mapview

hi all,

I have a mapview,
and I draw two point on the same mapview,
using
mapview.getoverlay().add(point1);
mapview.getoverlay().add(point2);

and now I want to clear point1,
I just can find:
mapview.getoverlay().clear() method to clear mapview,
but this action will clear point1 and point2,
but I just want to clear one point at the time.


so how can I do for my requestion??

thanks
--~--~---------~--~----~------------~-------~--~----~

2. switch to another applications programmatically

hi all,
Can anybody show me how to switch to another Android application
programmatically  or request focus on a specific application? My
situation is that, I have an Activity, and in that activity, I start
other UI application by "am" command. When the program runs, it float
to top screen, but it don't have focus. I need to focus to that
application's screen programmatically  for doing some automatic
action. How can I do this?

Thanks so much.
--~--~---------~--~----~------------~-------~--~----~

3. How can I get Activity object from Intent object or something else

4. how to add openobex to android

5. about webview.clearCache

6. Disable WebKit JavaScript security for XMLHttpRequest

7. problem to display multi line text..