I got a webview, which has a JSInterface :
mWebView.addJavascriptInterface(new JSInterfacelistArticle(mWebView, this, website), "interfaceWebsite");
When I use javascript function to call functions from my interface :
window.interfaceWebsite.doToast(info);
It’s working fine the first time, but when my activity finish(), and then I come back to this one, I got this error :
E/Web Console(28654): Uncaught TypeError: Cannot call method 'doToast' of undefined at :1
Why my interface is not working when I start my activity a second time ?
Edit:
If I remove window. when I call a function, I got :
Uncaught ReferenceError: interfaceWebsite is not defined at :1
So I’m sure my interface has a problem when loading for a second time…
Thanks
I overwritted my loadurl function for my webview :
I needed to set loadingFinished into a static variable sometimes ago, but I forgot that my var will not be updated when I create a new instance of my activity : just need to set loadingFinish at false;
Now, my thread wait until my webview load the website completely
Yeah, pretty stupid.