In my application I use WebView and in that I use the JavaScript alert( ) method, but it does not work, the popup does not appear.
in my manifest file i added
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
and in the activity file I added
mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl("file:///android_asset/demo.html");
In the layout of the xml file, I added
<WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" />
Any clue how to enable full JavaScript in WebView ?
Update
Thank you, the sign alert() method in the html file now works :).
Now in WebView there are two problems:
1: I use <textarea> in the html file that I upload to WebView and try to write the Hindi font in it, but when I try to write Hindi text, it displays as characters (rectangle characters like []).
when I do the same in the Firefox browser on the desktop, it works fine. any clue how to give support for multiple languages ββin textarea in WebView ?
2: When I click the "Send" button and try to open the text value in the alert() method in another java script, this does not work, does this mean even after using WebChromeClient it is applicable only to the current loaded html page, and not javascripts called with this page?
javascript android
user655192 Mar 11 2018-11-11T00: 00Z
source share