java - AGPS settings loading instead of location & security -


i have simple if statement check determine if gps turned on on app.

this works on emulator, when installed on actual device instead of 'location & security' menu being loaded called intent, loading agps option. menu not allow me turn gps on , have manually naviagte 'location & security' menu.

this alertdialog builder code. shown using intent call 'action_location_source_settings'.

alertdialog.setpositivebutton("settings",             new dialoginterface.onclicklistener() {                 public void onclick(dialoginterface dialog, int which) {                     intent intent = new intent(                             settings.action_location_source_settings);                     startactivity(intent);                 }             }); 

to highlight issue further ill use following screenshots:

this screen want load through intent:

enter image description here

the menu being loaded:

enter image description here

how enable intent load first menu instead of second?


Comments