android webview里HTML5的地理位置定位,在自己的webview不能定位

    webview=(WebView) findViewById(R.id.webview);
    webview.getSettings().setJavaScriptEnabled(true);//js
    webview.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);

    webview.getSettings().setDatabaseEnabled(true);
    String dir =this.getApplicationContext().
            getDir("database", Context.MODE_PRIVATE).getPath();
    webview.getSettings().setGeolocationEnabled(true);

    webview.getSettings().setGeolocationDatabasePath(dir);

    webview.getSettings().setDomStorageEnabled(true);


    webview.setWebViewClient(new WebViewClient());
    webview.setWebChromeClient(new WebChromeClient(){
        @Override
        public void onGeolocationPermissionsShowPrompt(String origin,
                Callback callback) {
            // TODO Auto-generated method stub
            super.onGeolocationPermissionsShowPrompt(origin, callback);
            callback.invoke(origin, true, false);
        }
    });
    webview.loadUrl("http://app.veryzhun.com/hotel/ctripSchedule");
    //http://app.veryzhun.com/hotel/ctripSchedule

在uc和原版浏览器中可以实现定位,在自己的webview中就没法实现 在csdn和百度上查到的资料都差不多 还是没法解决 求各位大大帮忙.

webSettings.setDatabaseEnabled(true);

String dir = this.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
//启用地理定位

webSettings.setGeolocationEnabled(true);

//设置定位的数据库路径

webSettings.setGeolocationDatabasePath(dir);
webSettings.setDomStorageEnabled(true)
public void onGeolocationPermissionsShowPrompt(String origin,

GeolocationPermissions.Callback callback) {

callback.invoke(origin, true, false);

super.onGeolocationPermissionsShowPrompt(origin, callback);

}


请问题主,这个问题解决了么?怎么解决的啊!我现在也有类似的问题!

楼主实现了没,实现了请教一下我,拜托了

手机设置只用网络定位就好了 用代码解决 我也不知道