【问题标题】:Best way to make call number or send a menssage拨打电话号码或发送消息的最佳方式
【发布时间】:2016-06-16 09:29:46
【问题描述】:

我想要的是 onclick in name = textview 它会弹出一个窗口,其中包含 2 个按钮 1 个用于电话呼叫的按钮和其他用于 sms 的按钮。

【问题讨论】:

  • 那么你已经走了多远?
  • 我卡住了,因为我不知道是否可以点击 textview 并弹出一个带有 2 个按钮的窗口
  • 您是否尝试将 onClick 事件添加到 textview
  • 是的,它只是制作一个自定义 dailog 并放置这两个按钮并在点击 textview 时显示为 dailog
  • 发布你的代码,你做了什么

标签: android sms phone-call


【解决方案1】:

首先google一下。什么是 alertdialog 框然后通过使用按钮单击拨打电话

Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phone1.getText().toString()));

其中 phone1 是 EditText 并发送短信喜欢

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + phoneNumber));     
intent.putExtra("sms_body", message); 
startActivity(intent);

希望你得到你想要的

【讨论】:

    猜你喜欢
    • 2020-04-08
    • 2016-04-15
    • 2018-03-09
    • 2015-10-24
    • 2016-08-11
    • 2015-01-31
    • 1970-01-01
    • 1970-01-01
    • 2021-01-22
    相关资源
    最近更新 更多