随笔分类 - android Webview实战
摘要:Android WebView使用基础 WebView是View的一个子类,可以让你在activity中显示网页。 可以在布局文件中写入WebView:比如下面这个写了一个填满整个屏幕的WebView: 加载一个网页,使用loadUrl():WebView myWebView = (WebV...
阅读全文
摘要:在Android的webview中定制js的alert,confirm和prompt对话框的方法http://618119.com/archives/2010/12/20/199.html1.首先继承android.webkit.WebChromeClient实现MyWebChromeClient。...
阅读全文
摘要:[1].[代码]删除保存于手机上的缓存.跳至[1][2][3]01// clear the cache before time numDays02privateintclearCacheFolder(File dir,longnumDays) {03intdeletedFiles =0;04if(dir!=null&& dir.isDirectory()) {05try{06for(File child:dir.listFiles()) {07if(child.isDirectory()) {08deletedFiles += clearCacheFolder(child, n
阅读全文
摘要://打开本包内asset目录下的index.html文件wView.loadUrl(" file:///android_asset/index.html "); //打开本地sd卡内的index.html文件wView.loadUrl("content://com.android.htmlfileprovider/sdcard/index.html");//打开指定URL的html文件wView.loadUrl(" http://m.oschina.net");
阅读全文

浙公网安备 33010602011771号