笑少
笑少
  • 发布:2022-01-15 17:45
  • 更新:2022-01-15 23:06
  • 阅读:453

android 的双卡拨打电话,怎么转native.js

分类:Native.js

public static void call(Context context, int id, String telNum, @Nullable String action){

    TelecomManager telecomManager = null;  
    List<PhoneAccountHandle> phoneAccountHandleList = null;  
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {//版本在21及以上  
         telecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);  
        if(telecomManager != null) {  
          phoneAccountHandleList = telecomManager.getCallCapablePhoneAccounts();  
        }  
    }  
        Intent intent = new Intent();  
        intent.setAction(action);  
        intent.setData(Uri.parse(telNum));  
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {//版本在23及以上  
            if (phoneAccountHandleList != null) {  
                intent.putExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, phoneAccountHandleList.get(id));  
            }  
        }  
        context.startActivity(intent);  
}
2022-01-15 17:45 负责人:无 分享
已邀请:
FullStack

FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866

可以做

该问题目前已经被锁定, 无法添加新回复