-
做android应用步骤
- 画页面
- 根据页面写对应的业务逻辑.
- studio中快捷键
- [1]alt + enter 相当于ctrl + 1
- [2]ctrl + d 复制
- [3]ctrl + y 删除
- [4]ctrl + p 查看参数类型
- [5]把一个局部变量变成一个成员变量 ctrl + alt + f
- 拨打电话的逻辑
String phone = mEt.getText().toString().trim(); if (phone == null) { Toast.makeText(this, "phone not null,thank!!!!", Toast.LENGTH_SHORT).show(); return; } Intent intent = new Intent(); intent.setAction(Intent.ACTION_CALL); intent.setData(Uri.parse("tel:" + phone)); startActivity(intent);
- 测试一下.
- 拨打电话要记得加上对应的权限
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>