当我运行应用程序时出现致命异常错误
android.content.ActivityNotFoundException:找不到处理Intent的活动
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// get butten
Button bt= (Button) findViewById(R.id.bt);
// set a monitor
bt.setOnClickListener(new MyListener());
}
class MyListener implements View.OnClickListener{
public void onClick(View v) {
EditText et = (EditText) findViewById(R.id.et);
String number = et.getText().toString();
Intent intent = new Intent();
intent.setAction(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel"+number));
startActivity(intent);
}
}
}