I am trying to open location settings in android using WebIntent plugin for phonegap. I use GPSDetector plugin for phonegap to detect if location is active and if it is not active i want to open Location Settings. After activate the location press Back button and go to index.html.
window.plugins.webintent.startActivity({
action: 'android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS'},
function() {},
function() {alert('Failed to open URL via Android Intent')}
);
In this case I don`t know which is the action, I have tried like this but did not work. I have made an activity and there i added in onCreate method :
startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);
But in this way i don`t know how to send the user back to index.html after he turns on the Location(Gps). Please help and Thanks a lot
I didn't use any available plugins. I wrote my own plugin and this is the java code of that plugin. Check if this is helpful. It works as your requirement for me.