i have this little issue, in iOS InAppBrowser works well, but in android no way, i turn on all external page in white list, i put a console.log to see if method is called, but doesn't open here how i handling with that
link : a href="#" onclick="openInAppBrowser('my link);" class="recents">
and the method
enter code here
function openInAppBrowser(url){
console.log('click in app brownser');
console.log('page: ' + url);
window.open(encodeURI(url), '_blank', 'location=yes');
}
Any idea? In iOS works fine but in android no way, if any one could help me
Did you enable JavaScript on your webview?
http://developer.android.com/guide/webapps/webview.html
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true)
Related
We have a WebView based android app which loads webpage consisting <a> tags linking to YouTube video.
The web app works fine in a browsers like Chrome for Android and loads thumbnail from YouTube as expected but within WebView the <a> tag won't load the thumbnail of YouTube video.
How can we force the WebView to behave similar to Chrome browser
Have tried setting clients like below, which didn't help
webview.setWebViewClient(new WebViewClient());
webview.setWebChromeClient(new WebChromeClient());
Even added hardware acceleration in AndroidManifest.xml but it didn't work either
android:hardwareAccelerated="true"
Note: JavaScript is also enabled.
Did you try to enable javascript in your webview?
You can enable it like this:
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
I'm having a problem with Android WebView for my websites. When I open my site on any browser, the CSS style sheet, JavaScript and Images load. But when I open for example through Instagram (which uses WebView), I just have the html, naked.
I precise that all my links are in relative (I have a tag which indicates from where to look for the files).
Here, my base is <base href="http://anthony-e-b.rf.gd/" target="_top">
and my CSS, my images, and my JS refer to this as:
<link rel="stylesheet" href="assets/main.css"> (for the CSS).
Same for my pictures : href="assets/pics/mon_image.jpg".
I do not understand, and although I search the Internet I do not see any solution ...
thank you in advance for your help
Try:
WebView myWebView = findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
Hope it will help!
I was trying to test if it is possible to integrate stripe js in a website and load that site in an android Webview to proceed for payment. I was using this link https://github.com/stripe/elements-examples to load that in Webview like this:
WebView browser = (WebView) findViewById(R.id.webview);
browser.loadUrl("https://stripe.github.io/elements-examples/");
Everything is loading in the Webview except the credit card field is not there. Either it is not visible or it can not be editable. Why is that?
Try to add below code to enable Javascript in your Webview:
WebSettings webSettings = browser.getSettings();
webSettings.setJavaScriptEnabled(true);
I have this piece of code on my WEB APP:
$(document).on('pageinit', function(){
$(".radius").on('change',function(){
$("#cercadeMiForm").submit();
});
});
No if I run this on my website, every time I change selection on the combo with class "radius", my form gets submitted properly.
If I run it on my mobile device standalone browser app, it works as well.
However, when I run it in my own app's webview, it does not work. I am using jQueryMobile and it seems to be working okay so I guess it's not a jQuery thing.
This is where I initialize my WebView:
mWebView = (WebView) findViewById(R.id.webView);
mWebView.getSettings().setUserAgentString(Constants.USER_AGENT);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginState(WebSettings.PluginState.ON);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
My webview will works for a site such as Google.com, however, the specific page will not load.
Simply displays subscribe to feedburner (I made this site to reflect a converted news feed)
This specific webpage will display correctly in an Iphone UIWebView, but not for Android.
Some code
WebView rss = (WebView) findViewById(R.id.webviewRSS);
rss.loadUrl("www.newmanu.edu/newmannews");
Check out the source of "www.newmanu.edu/newmannews", you have to activate javascript.
from http://developer.android.com/guide/webapps/webview.html
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
Add http:// or https:// before URL.
Try this.
rss.loadUrl("http://www.newmanu.edu/newmannews");
Or
rss.loadUrl("https://www.newmanu.edu/newmannews");