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. How do I get getResources() to work in another class?

I have a class called "public class Towers extends Activity {}" which is called 
in a main class called "public Step extends Activity {}".
In the "Towers" class I declare Drawables as follows:

public Resources myResources = getResources();
Drawable disc1 = myResources.getResources(R.drawable.disc1);


My code shows no errors but when I load it with Eclipse into an emulator  it 
indicates that there is an error "at Resources, package not specified, cannot 
find ....(oxf200001 not loaded)".

Any ideas?

Regards

Eugene

________________________________


NOTICE - This message and any attached files may contain information that is 
confidential, legally privileged or proprietary. It is intended only for use by 
the intended recipient. If you are not the intended recipient or the person 
responsible for delivering the message to the intended recipient, be advised 
that you have received this message in error. Any dissemination, copying, use 
or re-transmission of this message or attachment, or the disclosure of any 
information therein, is strictly forbidden. BlueScope Steel Limited does not 
represent or guarantee that this message or attachment is free of errors, virus 
or interference.

If you have received this message in error please notify the sender immediately 
and delete the message. Any views expressed in this email are not necessarily 
the views of BlueScope Steel Limited.

-- 

2. what android phone should i get?

im on sprint, im really considering getting the epic 4g, also im a power 
user and conseider myself to be very technically inclined

-- 
.

3. DevicePolicyMgr resetPassword requires android.permission.WRITE_SECURE_SETTINGS on 3.0?

4. Can WebView#onPageFinished be called after WebView#onPause has been called?

5. What is WebView.enablePlatformNotifications for?

6. refresh the gallery without restart the emulator

7. In-app billing refunds