ITeye博客

安卓 拨号界面和直接拨打界面

xinanadu · 2012-09-18 10:59 · android · 移动开发 · Markdown

/**
	 *打电话
	 * 
	 * @param tel
	 *            电话号码
	 */
	protected void call(String tel) {
		// 只进入拨号界面,不拨打
		 Uri uri = Uri.parse("tel:" + string);
		 Intent intent = new Intent(Intent.ACTION_DIAL, uri);
		 startActivity(intent);

		 //直接拨打
		Log.d(TAG, "call:" + tel);
		Uri uri = Uri.parse("tel:" + tel);
		Intent intent = new Intent(Intent.ACTION_CALL, uri);
		startActivity(intent);
	}

评论(1)

  1. #1 楼 · tangyunliang · 2014-07-18 10:25

    //直接拨打
    Log.d(TAG, "call:" + tel);
    Uri uri = Uri.parse("tel:" + tel);
    Intent intent = new Intent(Intent.ACTION_CALL, uri);
    startActivity(intent);

    不能直接拨打出去 还是跳到系统的拨号界面了 什么原因?

评论功能维护中,当前仅展示历史评论。