WebView: Javascript popup alert box not displayed.

by Kumaravel Kandasami » Fri, 13 Feb 2009 08:41:08 GMT


Sponsored Links
 I have simple html that would popup an alert box. Using WebView to display
the page... the popup does not display.

Any suggestions?

HTML Code:

<html>
<head>
</head>
<body>
<script type="text/javascript">
alert('Hello World!!!');
</script>
</body>
</html>

Activity code:

        super.onCreate(savedInstanceState);
        WebView browser = new WebView(this);
        browser.getSettings().setJavaScriptEnabled(true);
        browser.getSettings().setPluginsEnabled(true);

browser.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        browser.getSettings().setSupportMultipleWindows(true);
        WebChromeClient client = new WebChromeClient();
        browser.setWebChromeClient(client);
        browser.loadUrl("file:///android_asset/popup.htm");
        setContentView(browser);



Kumar    _/|\_
www.saisk.com
ku...@saisk.com
"making a profound difference with knowledge and creativity..."

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



Other Threads

1. Android Bug: Time.parse3339 crashes BEFORE it throws a TimeFormatException!

Here is some code I write to parse a 3339 time that I get back from
Google's gData:

                        try
                        {
                                Log.d("setUpdated", newTime );

                                Time time = new Time();
                                if( time.parse3339( newTime ) )
                                {
                                        this.mUpdated = time;
                                }
                        }
                        catch( android.util.TimeFormatException ex )
                        {
                                ex.printStackTrace();
                        }

Here is some of the log output from LogCat:

setUpdated   2010-01-07T20:26:29.000Z
setUpdated   2010-01-07T20:26:36.000Z
setUpdated   2010-01-07T20:26:22.000Z
setUpdated   2010-01-

Then it crashes because of a TimeFormatException.  The times are
coming from the gData calendar API so it is surprising that it returns
a bad time in only one case.  However, that is not the problem.

Notice that I said that it CRASHES because of a TimeFormatException,
not that it THROWS a TimeFormatException.  I said that because it
doesnt actually throw the exception!  If I put a breakpoint on the
stack trace line the de{*filter*} never gets there.  if I put a Log.d
there it doesnt display.  If i change the catch to an Exception it
still never gets there.  However, dalvikvm clearly outputs the
TimeFormatException and its stack trace to LogCat.  (I'd post it here
but you cant copy-paste from LogCat).

This leads me to believe that there is a bug in
android.text.format.Time.parse3339() where it crashes before it has
the opportunity to throw the exception it just logged!

Has anyone else seen this?  This is using Android 2.0.  Is it known
and fixed in 2.0.1?  Is there a way to report this to the android
devs?

2. Virtual Camera + Accelerometer + 3ds max

Good afternoon.

Here is my idea shortly: I want to make a virtual camera to 3ds max.
I mean, I want to be able to move my phone in space and then export the
transformations to my 3ds camera.

So I have to consider *basic *points:


   - how can I recover the accelerometer values and turn then into
   quaternion rotations?(It is possible?)
   - its possible to track movement(If I walk forward I could recover the
   distance's value)?


This basic points solved(I really really hope so) I have what can be called
*Virtual Camera Engine* set.

Now some *advanced* points:


   - its possible to render 3d content in the phone? Then I can load up my
   scene. (Low poly, of course.)
   - if so, using the Virtual Camera Engine is possible to "shoot" the
   scene, right?


Its a cheap version of James Cameron virtual camera system used in Avatar!
hehehehe

Come on people!

Thank you anyway!
Regards!

Guilherme

3. Common Component Externalization

4. Multiple versions of app with different package names

5. Multiple versions of app with different package names

6. AudioRecord works with short but static with byte

7. How to change widget layout background or hide it dynamically?