GPS functionality not working when webview is used in android -
i'm trying access gps using google maps, displayed using webview. gps enabled in device , following permissions given:
<uses-permission android:name="android.permission.internet"/>
<uses-permission android:name="android.permission.access_fine_location" />
this code webview part:
storelocator = (webview) findviewbyid(r.id.storelocator); storelocator.setwebviewclient(new webviewclient()); storelocator.getsettings().setjavascriptenabled(true); storelocator.getsettings().setgeolocationenabled(true); // storelocator.getsettings().setbuiltinzoomcontrols(true); storelocator.setwebchromeclient(new webchromeclient() { public void onprogresschanged(webview view, int progress) { locationdialog.show(); locationdialog.setprogress(0); activity.setprogress(progress * 1000); locationdialog.incrementprogressby(progress); if (progress == 100 && locationdialog.isshowing()) locationdialog.dismiss(); } }); storelocator.loadurl(getresources().getstring(r.string.location));
is there listener added sharing of location activated?
added these lines too, didn't work:
storelocator.setwebchromeclient(new webchromeclient() { public void ongeolocationpermissionsshowprompt(string origin, geolocationpermissions.callback callback) { // log.d("geolocation permission", "permission >>>"+origin); callback.invoke(origin, true, false); }});
Comments
Post a Comment