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;

posted on 2015-03-13 17:53  那里的天空  阅读(317)  评论(0编辑  收藏  举报

导航