سؤال

I have an application which needs to execute javascript in a Webview.

When I test it on mobile/tablet/note (Samsung Galaxy S3, Sony TX, Samsung N10.1...), it runs perfectly. However, when I test it on Kindle Fire (Android 4.3), the javascript code which I wrote in html file doesn't execute, and I'm not sure why.

هل كانت مفيدة؟

المحلول

Now, I got the answer. I must add the @JavascriptInterface annotation to any method that you want available to your JavaScript when running on Android 4.2 or higher.

Followed this http://developer.android.com/guide/webapps/webview.html

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top