【问题标题】:Initiate call activity in android without dialing在不拨号的情况下在android中发起呼叫活动
【发布时间】:2014-04-09 10:01:30
【问题描述】:

我一直在寻找如何在 Android 中做到这一点,我发现了这个问题:

How to make a phone call in android and come back to my activity when the call is done?

这段代码的内容:

String url = "tel:3334444";
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));

这会打开拨号活动并拨打第二个参数中指定的号码。问题是我需要打开拨号活动而不立即开始拨号,但是第二个参数中的数字已经插入到数字文本框中。

【问题讨论】:

    标签: android android-activity phone-call


    【解决方案1】:
    Intent callIntent = new Intent(Intent.ACTION_DIAL);
    callIntent.setData(Uri.parse("tel:" + phone_number));
    startActivity(callIntent);
    

    【讨论】:

    • 如何在创建后设置相同的参数而不是在构造函数中设置它有什么不同?
    • Intent.ACTION_CALL 和 Intent.ACTION_DIAL 的区别,其他代码相同
    • 哦,好吧,我没注意到,我试试看,然后把结果发回这里。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-11
    • 1970-01-01
    相关资源
    最近更新 更多