打电话的代码

it2022-05-05  99

一开始不知道怎么弄,网上一看很容易的,介绍给大家啊!几行代码就ok了

1 Intent phoneIntent = new Intent("android.intent.action.CALL", 2 Uri.parse("tel:" + phone)); 3 //启动 4 startActivity(phoneIntent);

phone是你给的号码

so easy!

1 final String phone=object.getString("handingTel"); 2 holder.image.setOnClickListener(new View.OnClickListener() { 3 @Override 4 public void onClick(View v) { 5 Intent phoneIntent = new Intent("android.intent.action.CALL", 6 Uri.parse("tel:" + phone)); 7 //启动 8 startActivity(phoneIntent); 9 } 10 });

我用到的时候就这么写的,可以看看

转载于:https://www.cnblogs.com/wangying222/p/5784057.html

相关资源:各显卡算力对照表!

最新回复(0)