相关疑难解决方法(0)

打个电话点击按钮

当我在android中按下按钮时,我正在尝试拨打电话

((Button)findViewById(R.id.button1)).setOnClickListener(new OnClickListener() {
  @Override
  public void onClick(View v) {
    String phno="10digits";

    Intent i=new Intent(Intent.ACTION_DIAL,Uri.parse(phno));
    startActivity(i);
  }
});
Run Code Online (Sandbox Code Playgroud)

但是当我跑步并点击按钮时,它会给我错误

ERROR/AndroidRuntime(1021): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.CALL dat=9392438004 }
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

android button phone-call

50
推荐指数
6
解决办法
13万
查看次数

标签 统计

android ×1

button ×1

phone-call ×1