diff --git a/docs/html/about/versions/android-4.2.jd b/docs/html/about/versions/android-4.2.jd index 13ee872798c49..b02c1d10f4d98 100644 --- a/docs/html/about/versions/android-4.2.jd +++ b/docs/html/about/versions/android-4.2.jd @@ -111,6 +111,20 @@ android:targetSdkVersion} and {@code targetSdkVersion} + to 17 or higher, you must now add the {@code @JavascriptInterface} annotation to any method that you + want available to your JavaScript (the method must also be public). If you do not provide the + annotation, the method is not accessible by a web page in your {@link android.webkit.WebView} + when running on Android 4.2 or higher. If you set the + {@code targetSdkVersion} + to 16 or lower, the annotation is not required, but we recommend that you update your target version + and add the annotation for additional security. +

Read more about binding + JavaScript code to Android code.

diff --git a/docs/html/guide/webapps/webview.jd b/docs/html/guide/webapps/webview.jd index f8b2a1dbc2019..d2b253214ba16 100644 --- a/docs/html/guide/webapps/webview.jd +++ b/docs/html/guide/webapps/webview.jd @@ -178,8 +178,8 @@ public class WebAppInterface { href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion} to 17 or higher, you must add the {@code @JavascriptInterface} annotation to any method that you want -available your web page code (the method must also be public). If you do not provide the -annotation, then the method will not accessible by your web page when running on Android 4.2 or +available to your JavaScript (the method must also be public). If you do not provide the +annotation, the method is not accessible by your web page when running on Android 4.2 or higher.

In this example, the {@code WebAppInterface} class allows the web page to create a {@link