Answer the question
In order to leave comments, you need to log in
Why doesn't addJavascriptInterface work in Android?
I have an Activity with a WebView
webView.getSettings().setJavaScriptEnabled(true);
webView.addJavascriptInterface(
new PhotoStorage(this),
"PhotoStorage"
);
Answer the question
In order to leave comments, you need to log in
In general, I figured it out - at the first redirect, work began in a standard browser. Treated by adding your own WebView, in which the shouldOverrideUrlLoading method is overridden
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (
Uri.parse(url).getHost().contains("sonyagent") ||
(Uri.parse(url).getPort() == 3000)
){
return false;
}
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question