Einzelnen Beitrag anzeigen

linxxruxx

Registriert seit: 19. Aug 2019
28 Beiträge
 
#9

AW: Chat via Rocket.Chat in Delphi

  Alt 3. Sep 2019, 15:00
Habe nur übersehen, dass "ShellExecute" nur unter Windows läuft.
Möchte man allerdings unter Android einen Browser-Link öffnen, muss das in etwa so aussehen:

Code:
unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes,
  System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
  FMX.Controls.Presentation, FMX.StdCtrls,
  Androidapi.JNI.GraphicsContentViewText, Androidapi.JNI.Net,
  Androidapi.JNI.App, Androidapi.helpers;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

procedure TForm1.Button1Click(Sender: TObject);
Var
  Intent: JIntent;
begin
  Intent := TJIntent.Create;
  Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
  Intent.setData(StrToJURI('http://www.youtube.com'));
  tandroidhelper.Activity.startActivity(Intent);
end;

end.
  Mit Zitat antworten Zitat