Passing json object when calling android javascript method?

I want to call the say success (message) javascript method from android activity. I do it as follows:

webView.loadUrl(javascript:success(message));

But this message = JSON object from the answer http://weather.yahooapis.com/forecastjson?w=12844782&u=c . So how can I make the correct url (message) in android?

Thanks
Sneha

+3
source share
1 answer
  • you must read all the content from the specified URL (http://weather.yahooapis.com/forecastjson?w=12844782&u=c). do this using an HttpClient or URL connection. let me know if you don’t know how to do this. save contents for some var (e.g. message)
  • : webView.loadUrl( "javascript: success (" + message + ")" );

, :)

0

All Articles