Pass a value to loadURL - Android

前端 未结 3 714
灰色年华
灰色年华 2020-12-30 08:32

Is it possible to pass a value to the URL mentioned in webView.loadUrl? something like this??

webView.loadUrl(\"file:///android_asset/www/index.html#value=\"         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 09:33

    You'll want to use a GET-Query string to do so. Note that the maximum length of a URL is 256 chars!

    After you supplied your arguments that way, you can use JavaScript to read them (by cutting them out of the URL). Here is a Code-Snipped and an article on this topic.

提交回复
热议问题