• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps realy need help to a app

zanderdk

Lurker
Aug 2, 2010
2
0
i made a browser but it can't download plzz help

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setContentView(R.layout.main);


WebView web = (WebView) findViewById(R.id.webView);
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setPluginsEnabled(true);
web.getSettings().setSupportMultipleWindows(true);
web.getSettings().setSupportZoom(true);
web.setVerticalScrollBarEnabled(true);
web.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
web.setHorizontalScrollBarEnabled(true);
web.getSettings().setBlockNetworkImage(false);
web.getSettings().setLoadsImagesAutomatically(true);
web.getSettings().setUserAgent(0);
web.getSettings().setUseWideViewPort(true);
web.loadUrl("http://google.com/");

web.setWebViewClient(new WebViewClient() {
@Override public boolean shouldOverrideUrlLoading(WebView view, String url) {
return false;
}
});
}
}
 
It would be helpful if you explain you problem more clearly. Like what does it do now. Does it crash or just don't load the page.

From what I can see here, you are just using a webview so my guess is that you haven't set the permissing for using the internet. If you haven't done this your app is not allowed to use the internet and therefore can't load the webpage.

~id
 
Upvote 0
It would be helpful if you explain you problem more clearly. Like what does it do now. Does it crash or just don't load the page.

From what I can see here, you are just using a webview so my guess is that you haven't set the permissing for using the internet. If you haven't done this your app is not allowed to use the internet and therefore can't load the webpage.

~id
Hi I am also have the same issue My webView Doesnot load the URL
WebView mWebView ;
mWebView = (WebView)findViewById(R.id.mWebView);

mWebView.getSettings().setJavaScriptEnabled(true);

mWebView.loadUrl(
"http://developer.android.com/index.html"
);

I have given this tag
<uses-permissionandroid:name="android.permission.INTERNET"></uses-permission>
in the manifest also.
Andriod default brower can open the above url but through WebView It gives the Page is not available, i tried with "http://google.com" also but the same error,

Please help
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones