Android webview geoposition database failed to open

前端 未结 3 1168
小鲜肉
小鲜肉 2021-01-02 02:56

I have website using javascript geolocation api and want it to open in a webview. I set up these permissions in the manifest file:



        
3条回答
  •  时光说笑
    2021-01-02 03:19

    I know this is an old question but anyone with this issue might find interesting focusing on this function:

    mWebView.getSettings().setGeolocationDatabasePath(getFilesDir().getPath());
    

    Geolocation uses databases to persist cached positions and permissions between sessions. This call sets the location of the database.

    Instead of setting a fixed path as parameter you should get it dynamically calling:

    getFilesDir().getPath()
    

提交回复
热议问题