Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面
(2013-11-22 23:08:44)
现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
1、跳转到拨号界面,代码如下:
1)直接拨打
-
Intent
intentPhone = new Intent(Intent.ACTION_CALL,
Uri.parse("tel:" +
phoneNumber));
startActivity(intentPhone);
-
2)跳转到拨号界面
-
Intent
intent = newIntent(Intent.ACTION_DIAL,Uri.parse("tel:" + phoneNumber));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent); -
-
2、跳转到联系人页面,使用一下代码:
-
Intent intentPhone = new Intent(Intent.ACTION_CALL,
Uri.parse("tel:" +
phoneNumber));
startActivity(intentPhone);
|