小编Rea*_*man的帖子

Android Intent.ACTION_CALL,Uri

我正在尝试使用Intent.Action类.我知道如何使用ACTION_VIEW显示URL但我想Intent.ACTION_DIAL在启动应用程序时使用to call号码.文档说您需要将URI解析为字符串,然后将其添加到Intent我试过这个:

Uri call = Uri.parse("7777777777");             
Intent surf = new Intent(Intent.ACTION_DIAL, call); 
startActivity(surf);
Run Code Online (Sandbox Code Playgroud)

这不起作用我收到一条错误消息说:

不幸的是,Project已经停止了.我试图调试代码,它似乎指向意图行不确定我做错了,如果我这样做它工作并带来拨号器.

//Uri call = Uri.parse("7777777777");               
Intent surf = new Intent(Intent.ACTION_DIAL);   
startActivity(surf);
Run Code Online (Sandbox Code Playgroud)

android android-intent

11
推荐指数
2
解决办法
7万
查看次数

标签 统计

android ×1

android-intent ×1