android-json-rpc

How to json parse a url parameter in android webview?

有些话、适合烂在心里 提交于 2019-12-02 23:02:23
问题 I have a webview where I am injecting javascript after page has finished loading (onpagefinished)as follows: @Override public void onPageFinished(WebView view, String url) { String jscontent = ""; try{ AssetManager manager = view.getContext().getAssets(); InputStream is = manager.open("page.js"); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line; while (( line = br.readLine()) != null) { jscontent += line; } is.close(); } view.loadUrl(

How to json parse a url parameter in android webview?

折月煮酒 提交于 2019-12-02 13:05:15
I have a webview where I am injecting javascript after page has finished loading (onpagefinished)as follows: @Override public void onPageFinished(WebView view, String url) { String jscontent = ""; try{ AssetManager manager = view.getContext().getAssets(); InputStream is = manager.open("page.js"); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line; while (( line = br.readLine()) != null) { jscontent += line; } is.close(); } view.loadUrl("javascript:" + jscontent); } This is the javascript page I am reading: page.js: if (window.page) {