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. starting two emulators and building apps for one or the other with new 1.5 SDK





David,


Thanks a lot.

the adb command line is fine for me.
I'll do now:

ant debug && adb -s emulator-5554 install <package>


What is a little annoying is though, that I don't know how to
establish a direct mapping between an avd and the port name, that it
is using.

So depending on whether I started the emulator for device d1 before
device d2 or
vice versa  I have to adapt the adb device name.

This is no killer at all, but I'd be curious whether anybody had an
idea of how to do this nicely.

The only very clumsy idea, that I have:

- the lock file in ~/.android/avd/<Device>.avd/*.lock just reveals the
process id

- netstat -p | grep 'tcp' | grep $processid
returns the emulator port

-  and emulator port - 1 will allow me to determine the device name,
that I had to use
for adp install.


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

2. How can I test the video recording functionality in the new emulator

Hi,

How can I test the video recording functionality in the new emulator
in 1.5 android preview SDK?

Thank you.

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

3. ContentObserver triggers repeatedly for contacts

4. starting two emulators and building apps for one or the other with new 1.5 SDK

5. starting two emulators and building apps for one or the other with new 1.5 SDK

6. Better way to debug when there is jar dependancies?

7. repo sync - no response