Flipboard / GoldenGate

An Android annotation processor for generating type safe javascript bindings (Bridges)
BSD 3-Clause "New" or "Revised" License
120 stars 19 forks source link

Use WebView.evaluateJavascript() for KitKat and higher #8

Closed petershu closed 9 years ago

petershu commented 9 years ago

Using WebView.loadUrl("javascript:...") works differently when targetting KitKat or newer. After KitKat, calling loadUrl() will evaluate the URL and completely replace the contents of the current page. To avoid losing JavaScript variable bindings, we should use WebView.evaluateJavascript() (added in KitKat).

More Info: https://commonsware.com/blog/2013/10/31/quick-musings-android-4p4.html