Ryan Temple Ryan Temple - 4 months ago 29
Java Question

onJsAlert return message is object not string

I'm making a call

webView.setUpWebChromeClient( new WebChromeClient() {

public boolan onJsAlert(WebView view, String url, final String message, JsResult result) {

The message im getting is coming back as

[object Object];

It's supposed to be a JSON object thats the response however I can only get the String representation of the object. Please help on how I would access the object!


It's probably a json object but you are viewing it as a String. So you will need to translate the object to a String representation using JSON.stringify if you want to view it:


Instead of