【发布时间】:2012-02-13 09:40:48
【问题描述】:
我在此论坛中找到了此代码,但我无法在电话号码中使用此字符(# 或 /u0023)。
我知道这个问题已经被问过了,但你可能知道“Go SMS Pro”应用程序,这个应用程序实际上可以拨打这个号码。现在我想问你是否知道如何管理它。
try {
Intent callIntent = new Intent(Intent.ACTION_CALL);
String number = "tel:*100#"; /This is the number
callIntent.setData(Uri.parse(asd));
startActivity(callIntent);
TelephonyManager tManager = (TelephonyManager)
getSystemService(Context.TELEPHONY_SERVICE);
PhoneStateListener listener = new PhoneStateListener();
tManager.listen(listener, PhoneStateListener.LISTEN_CALL_STATE);
} catch (ActivityNotFoundException activityException) {
Log.e("telephony-example", "Call failed", activityException);
}
【问题讨论】:
-
你有没有尝试转义字符\
标签: android android-intent phone-number phone-call tel