效果图:

使用隐式Intent打开系统内置拨号界面

 

3行代码搞定。

 Intent intent1=new Intent(Intent.ACTION_DIAL);
 intent1.setData(Uri.parse("tel:10086"));
 startActivity(intent1);

首先指定了Intent的action是Intent.ACTION_DIAL,这又是一个Android系统的内置动作。然后传入一个"tel:10086"字符串,然后被解析成Uri行的实例作为参数传入setData()方法中就ok了。

相关文章:

  • 2022-02-03
  • 2022-01-26
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2021-08-28
  • 2021-08-20
  • 2021-09-21
相关资源
相似解决方案