|
|
|
@ -7,6 +7,7 @@ import androidx.appcompat.app.AppCompatActivity; |
|
|
|
import android.annotation.TargetApi; |
|
|
|
import android.app.Activity; |
|
|
|
import android.content.ClipData; |
|
|
|
import android.content.Context; |
|
|
|
import android.content.Intent; |
|
|
|
import android.graphics.Bitmap; |
|
|
|
import android.net.Uri; |
|
|
|
@ -97,9 +98,19 @@ public class MainActivity extends AppCompatActivity { |
|
|
|
web.getSettings().setUseWideViewPort(true); |
|
|
|
//设置缓存大小为50M
|
|
|
|
web.getSettings().setCacheMode(50*1024*1024); |
|
|
|
// 缓存的路径
|
|
|
|
String appCacheDir = this.getApplication().getDir("ggcache", Context.MODE_PRIVATE).getPath(); |
|
|
|
// web.getSettings().setAppCachePath(appCacheDir);
|
|
|
|
web.getSettings().setAllowFileAccess(true); |
|
|
|
// web.getSettings().setAppCacheEnabled(true);
|
|
|
|
web.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT); |
|
|
|
//Dom Storage 缓存机
|
|
|
|
web.getSettings().setDomStorageEnabled(true); |
|
|
|
|
|
|
|
// 应用可以有数据库
|
|
|
|
web.getSettings().setDatabaseEnabled(true); |
|
|
|
String dbPath =this.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath(); |
|
|
|
web.getSettings().setDatabasePath(dbPath); |
|
|
|
|
|
|
|
web.setInitialScale(100); |
|
|
|
web.loadUrl(url); |
|
|
|
|
|
|
|
|