Android WebStorage deleteOrigin无法正常工作,不会删除任何内容

时间:2019-10-29 08:07:31

标签: android webview web-storage

我正在尝试删除单个来源的WebStorage数据。首先显示大小(以检查是否要删除其中包含一些数据的原点),然后调用deleteOrigin。

final String origin = "https://developers.android.com/";
WebStorage.getInstance().getUsageForOrigin(origin, new ValueCallback<Long> () {
    @Override
    public void onReceiveValue(Long value) {
        Log.d("TEST", "Before " + origin + " delete=" + value.toString());
        // delete origin
        WebStorage.getInstance().deleteOrigin(origin);
        Log.d("TEST", origin + " deleted!");
    }
});

在日志中,我看到:

2019-10-29 09:02:26.305 27887-27887/? D/TEST: Before https://developer.android.com/ delete=27793073
2019-10-29 09:02:26.311 27887-27887/? D/TEST: https://developer.android.com/ deleted!

但是当我运行几次时,甚至重新启动应用程序。该数字仍然相同:

2019-10-29 09:05:11.366 27887-27887/? D/TEST: Before https://developer.android.com/ delete=27793073
2019-10-29 09:05:11.369 27887-27887/? D/TEST: https://developer.android.com/ deleted!
2019-10-29 09:05:11.582 27887-27887/? D/TEST: Before https://developer.android.com/ delete=27793073
2019-10-29 09:05:11.586 27887-27887/? D/TEST: https://developer.android.com/ deleted!

0 个答案:

没有答案