How to remove the WebView top/left 8-pixel inner margin?

by elDoudou » Fri, 10 Apr 2009 21:01:27 GMT

Sponsored Links

After some search, even in the WebView and related classes source
code, I could not find where the built-in 8-pixel inner margin of a
WebView is set. I would like to display a WebView with no inner
margin: is it feasible, please? Or am I missing something and there is
no top and left inner margin inside a WebView?

Thank you for your help and support. Regards,

How to remove the WebView top/left 8-pixel inner margin?

by elDoudou » Mon, 13 Apr 2009 18:13:08 GMT

 Anyone on this? Do I need to reformulate my question? I know it sounds
cosmetics, but since I need to display a HTML banner, the need for
accuracy is really needed? Android Googlers, your help is very
welcome ;) Regards, douard

Sponsored Links

How to remove the WebView top/left 8-pixel inner margin?

by elDoudou » Tue, 14 Apr 2009 02:37:31 GMT

 That was my fear, i.e. that the left and top margin be hard-coded deep
down on the C inaccessible layer ;( Thank you for taking the time. By
"accuracy", I mean that I want to control the width of the total
WebView widget, so that it takes exactly 320 pixels and that the
loaded HTML inside the WebView contains a 320-wide pixels image that
should perfectly fit the Android device width of 320 pixels... This
does not seem to be possible because of this built-on margin, except
in a margin can be set negative...

Other Threads

1. How To Recreate WindowManager$BadTokenException ?

I'm getting a few reports in the Market of my users experiencing a
WindowManager$BadTokenException from an
call. (Full stack trace and relevant code below.) I've read what can
cause this to happen but no matter what I try, I can't cause the
exception to be thrown on any of my emulators or my Nexus One.

I've tried hitting the Back and Home buttons just as the dialog is
about to be displayed, changing the phone's orientation, and launching
multiple other apps in an attempt to get my app paused/resumed.

Anyone have any ideas on other actions I can take to try and cause the


Stack Trace:

android.view.WindowManager$BadTokenException: Unable to add window --
token android.os.BinderProxy@46042700 is not valid; is your activity
at android.view.ViewRoot.setView(
at android.view.WindowManagerImpl.addView(
at android.view.WindowManagerImpl.addView(
at android.view.Window$LocalWindowManager.addView(
at com.hoyski.androidsquares.Squares.showGameOverDialog(
at com.hoyski.androidsquares.Squares.computerMoveOnce(
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(
at dalvik.system.NativeStart.main(Native Method)

Relevant Code:

private void showGameOverDialog() {

        AlertDialog.Builder gameOverBldr = new AlertDialog.Builder(this);
                new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {

        String title = "Game Over";
        String msg = "... logic to build message snipped...";



2. CVE-2009-1185 and CVE-2010-EASY patches


     I am looking for patches for CVE-2009-1185 and CVE-2010-EASY for
Android.  I believe the patches are included in Android 2.2.2 and
later.  Please let me know where I can get the patches and it would be
good to for the pointer for the patches for 2.2 to 2.2.2.  By the way,
I also cannot find a release note for 2.2.2.

Thank you.


3. Spinner like drop-down on button

4. Android boot process deadlock

5. Problem with Mezzofanti ( Android-phone application) :

6. Update : Lelang Moto Q : Bersih2 laci

7. get Notification on specified time.