Registriert seit: 13. Jan 2004
Ort: Hamm(Westf)
1.930 Beiträge
Delphi 12 Athens
|
AW: Aufruf Programme mit Firemonkey
11. Aug 2017, 17:20
ok es sieht jetzt so aus.
Delphi-Quellcode:
Procedure OpenDocument(sCommand: String);
{$IFDEF IOS}
var
NSU: NSUrl;
{$ENDIF IOS}
{$IFDEF ANDROID}
var
Intent: JIntent;
{$ENDIF ANDROID}
Begin
{$IFDEF WIN32}
ShellExecute(0, ' OPEN', PChar(sCommand), ' ', ' ', SW_SHOWNORMAL);
{$ENDIF WIN32}
{$IFDEF IOS}
// iOS doesn't like spaces, so URL encode is important.
NSU := StrToNSUrl(TIdURI.URLEncode( URL));
if SharedApplication.canOpenURL(NSU) then
SharedApplication.openUrl(NSU);
{$ENDIF IOS}
{$IFDEF ANDROID}
Intent := TJIntent.Javaclass.init(TJIntent.JavaClass.ACTION_VIEW,
StrToJURI(sCommand));
Intent.setFlags(TjIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK);
TAndroidhelper.Activity.startActivity(Intent);
{$ENDIF ANDROID}
End;
Andreas Monads? Wtf are Monads?
|
|
Zitat
|