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. Using IMEs

1. The softkeyboard sample, after installation, how do I use it?
2. Can I replace the default system IME (popup keyboard)? If yes, how?

Cheers,
Earlence

-- 

2. Input Method Framework: How to use?

Hi,

I need to learn how to use the IMF to design a soft keyboard. Please
point me to some resources that will help me understand how to do it
from the ground up. Something other than the SDK sample

Cheers,
Earlence

-- 

3. Changing the name of a project/package

4. Bluetooth Conenction Problem

5. Setup Multiple Alarms

6. Browser Source code

7. Popping up Toast (or something like it) from a thread