解压就可运行。public class PhoneActicity extends Activity { private EditText mobileText; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mobileText = (EditText)this.findViewById(R.id.mobile); Button button = (Button)this.findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { String mobile = mobileText.getText().toString(); //拔打电话号码 //"android.intent.action.CALL" Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+ mobile)); startActivity(intent);//内部会添加android.intent.category.DEFAULT
2021-09-02 16:37:13 21KB 实现打电话功能
1