如何在webview android

时间:2016-01-05 08:02:42

标签: android caching webview

我想在webview android中启用缓存。我正在webview中加载一个url我想要的是当我在webview中再次打开相同的url时,它应该从缓存中加载该url以便加快加载速度,我该如何实现呢?

1 个答案:

答案 0 :(得分:8)

您可以使用WebView缓存在WebView中启用缓存。

在WebView的属性中添加以下行:

(function () {

    "use strict";

    angular.module("common.services")//common.services
        .factory("agencyResource",
                [
                 "$resource",
                 "appSettings",
                  agencyResource
                ])

    function agencyResource($resource, appSettings) {
        return $resource(appSettings.serverPath + "/api/v1/agencies/:id", null,
            {
                'update': { method: 'PUT' },
            });
    }

}());