除了使用Delphi之外,如何与以下代码相同?
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:0987654321"))
startActivity(intent);
答案 0 :(得分:2)
这可能有帮助:
uses
Androidapi.Helpers, Androidapi.JNI.GraphicsContentViewText, Androidapi.JNI.Net;
procedure Dial(const ANumber: string);
var
LIntent: JIntent;
begin
LIntent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_DIAL);
if LIntent.resolveActivity(TAndroidHelper.Context.getPackageManager) <> nil then
begin
LIntent.setData(TJnet_Uri.JavaClass.parse(StringToJString('tel:' + ANumber)));
TAndroidHelper.Context.startActivity(LIntent);
end
else
ShowMessage('Cannot dial!');
end;