首页 > 代码库 > delphi xe6 打开andoridGPS设置

delphi xe6 打开andoridGPS设置

  Androidapi.JNI.JavaTypes, 
  Androidapi.JNI.GraphicsContentViewText,
  Androidapi.JNI.Location,
  Androidapi.JNIBridge,
  Androidapi.JNI.Os,
  Androidapi.Helpers,
  Androidapi.JNI.Provider;
.............................
procedure TForm2.Button6Click(Sender: TObject);
var
  Provider:string;
  Settings_secure:TJSettings_Secure;
  Intent:JIntent;
begin
  Provider:=JStringToString(Settings_secure.JavaClass.getString(
  SharedActivityContext.getContentResolver,
  TJSettings_system.javaClass.LOCATION_PROVIDERS_ALLOWED));
// if pos(‘gps‘,provider)=0 then
// begin
    Intent:=TJIntent.Create;
    Intent.setAction(TJSettings.javaClass.ACTION_LOCATION_SOURCE_SETTINGS);
    SharedActivity.startActivity(Intent);
// end;
end;