有人可以解释我在尝试从网上下载.apk时如何模仿默认浏览器吗?
到目前为止我有这个:
WebView webview; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); webview = (WebView) findViewById(R.id.webview); webview.setWebViewClient(new HelloWebViewClient()); WebSettings webSettings = webview.getSettings(); webSettings.setSavePassword(false); webSettings.setSaveFormData(false); webSettings.setJavaScriptEnabled(true); webSettings.setSupportZoom(false); webview.setDownloadListener(new DownloadListener() { public void onDownloadStart(final String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { Toast.makeText(testapp.this, url, Toast.LENGTH_LONG); } }); webview.loadUrl("http://dacp.jsharkey.org/TunesRemote-r2.apk"); }
我已经添加了使用互联网的许可.我还需要添加其他权限吗?我不正确地做了DownloadListener吗?
先感谢您!