} catch (Exception e) {}
if (phoneNum != null & phoneNum.trim().length() > 0) {
String strAnswer = “正在打电话给:” + peopleName;
tvAnswer.setText(strAnswer);
startSpeak(strAnswer);
Uri uri = Uri.parse(“tel:” + phoneNum);
Intent intent = new Intent(Intent.ACTION_CALL, uri);
startActivity(intent);
} else if (phoneCode != null& phoneCode.trim().length() > 0) {
String strAnswer = “正在打电话给:” + peopleName;
tvAnswer.setText(strAnswer);
startSpeak(strAnswer);
Uri uri = Uri.parse(“tel:” + phoneCode);
Intent intent = new Intent(Intent.ACTION_CALL, uri);
startActivity(intent);
} else {
String phoneNumFromPinYin = getContactNumberByPinYin(PinYinUtil.convertAll(peopleName));
if (phoneNumFromPinYin != null& phoneNumFromPinYin.trim().length() > 0) {
String strAnswer = “正在打电话给:” + peopleName;
tvAnswer.setText(strAnswer);
startSpeak(strAnswer);
Uri uri = Uri.parse(“tel:” + phoneNumFromPinYin);
Intent intent = new Intent(Intent.ACTION_CALL, uri);
startActivity(intent);
} else {
String strAnswer = “通讯录中未找到:” + peopleName;
tvAnswer.setText(strAnswer);
startSpeak(strAnswer);
}
}
}