android51拨号
发布时间: 2023-04-10 12:40:47
❶ Android 跳转到拨号界面如何自动填写手机号,但是不自动拨出
1、跳转到拨号界面,代码如下:
1)直接拨打
java">IntentintentPhone=newIntent(Intent.ACTION_CALL,Uri.parse("tel:"+phoneNumber));
startActivity(intentPhone);
2)跳转到拨号界面
Intentintent=newIntent(Intent.ACTION_DIAL,Uri.parse("tel:"+phoneNumber));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
2、跳转到联系人页面,使用一下代码:
IntentintentPhone=newIntent(Intent.ACTION_CALL,Uri.parse("tel:"+phoneNumber));
startActivity(intentPhone);
❷ android开发怎么拨打电话
无权限版(弹出拨号界面并自动输入电话号码,用户选择是否拨号):
importandroid.content.Context;
importandroid.content.Intent;
importandroid.net.Uri;
publicvoidCall(StringNum,Contextc){
if(Num!=null&&Num.length()>0){
Intentitt=newIntent(Intent.ACTION_DIAL,Uri.parse("tel:"+Num));
itt.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
c.startActivity(itt);
}
}
权限版(弹出拨号界面,自动输入电话号码并立刻拨号,在部分系统中会触发安全警告):
<!---权限--->
<uses-permissionandroid:name="android.permission.CALL_PHONE"/>
importandroid.content.Context;
importandroid.content.Intent;
importandroid.net.Uri;
publicvoidCall(StringNum,Contextc){
if(Num!=null&&Num.length()>0){
Intentitt=newIntent(Intent.ACTION_CALL,Uri.parse("tel:"+Num));
itt.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
c.startActivity(itt);
}
}
❸ Android调用拨打电话和发送短信
拨打电话常见两种方法
1:直接拨打了你所输入的号码
2:去到了拨号界面
这种方式的特点就是,去到了拨号界面,但是实际的拨号是由用户点击实现的。
记得加入打电话的权限
<uses-permission android:name="android.permission.CALL_PHONE" />
发送短信也可以直接跳到发送短信页面也可以直接发送短信内容
编辑发送短信
1.编辑指定发送人和内内容:
2.编辑短信并发送
热点内容