打电话的代码

一开始不知道怎么弄,网上一看很容易的,介绍给大家啊!几行代码就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         });

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

posted on 2016-08-18 15:21  oooo呼呼  阅读(513)  评论(0编辑  收藏  举报