Using local storage on Android webview

前端 未结 3 1136
栀梦
栀梦 2021-01-14 04:15

I am experimenting with Android code: I would like to store one value using HTML 5 local storage. For this exercise I\' using a page as simple as this one: http://www.w3s

3条回答
  •  再見小時候
    2021-01-14 04:47

    It appears the empty string DatabasePath is the problem. I tried similar code and with an empty string path, the value does not persist after the app exits. If I define a specific database path, the value persists as expected.

    Try:

    webSettings.setDatabasePath("/data/data/"+this.getPackageName()+"/databases/");
    

提交回复
热议问题