Firemonkey [안드로이드] 외부어플 브라우져 및 PDF 호출 방법
2013.10.29 22:59
// ** Open a URL
uses
Androidapi.JNI.GraphicsContentViewText,
FMX.Helpers.Android;
procedure TForm3.Button1Click(Sender: TObject);
var
Intent: JIntent;
begin
Intent := TJIntent.Create;
Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
Intent.setData(StrToJURI('http://www.google.com'));
SharedActivity.startActivity(Intent);
end;
// ** Open a PDF File
uses
Androidapi.JNI.GraphicsContentViewText,
Androidapi.JNI.JavaTypes,
FMX.Helpers.Android;
procedure TForm3.Button1Click(Sender: TObject);
var
Intent: JIntent;
begin
Intent := TJIntent.Create;
Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
Intent.setDataAndType(StrToJURI('filepath'), StringToJString('application/pdf'));
SharedActivity.startActivity(Intent);
end;