本文整理了Java中android.telephony.TelephonyManager.getVoiceMailNumber()
方法的一些代码示例,展示了TelephonyManager.getVoiceMailNumber()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TelephonyManager.getVoiceMailNumber()
方法的具体详情如下:
包路径:android.telephony.TelephonyManager
类名称:TelephonyManager
方法名:getVoiceMailNumber
暂无
代码示例来源:origin: square/assertj-android
public TelephonyManagerAssert hasVoiceMailNumber(String number) {
isNotNull();
String actualNumber = actual.getVoiceMailNumber();
assertThat(actualNumber) //
.overridingErrorMessage("Expected voice mail number <%s> but was <%s>.", number,
actualNumber) //
.isEqualTo(number);
return this;
}
代码示例来源:origin: robolectric/robolectric
@Test
public void shouldGiveVoiceMailNumber() {
shadowOf(telephonyManager).setVoiceMailNumber("123");
assertEquals("123", telephonyManager.getVoiceMailNumber());
}
代码示例来源:origin: stackoverflow.com
TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String ableToMakePhoneCalls = tm.getVoiceMailNumber();
//check device for voicemail number (null means no voicemail number).
if(ableToMakePhoneCalls == null)
{
//If the device does not have voicemail, then it must not be a phone. So it can't call.
}
代码示例来源:origin: stackoverflow.com
TelephonyManager tel = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
return tel.getVoiceMailNumber();
代码示例来源:origin: stackoverflow.com
callButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String ableToMakePhoneCalls = tm.getVoiceMailNumber(); //check device for voicemail number (null means no voicemail number).
if(ableToMakePhoneCalls == null){ //If the device does not have voicemail, then it must not be a phone. So it can't call.
//I displayed an alert dialog box here
}
else{
String phoneNum = "tel:8885554444";
Intent intentPhone = new Intent(android.content.Intent.ACTION_CALL);
intentPhone.setData(Uri.parse(phoneNum));
startActivity(intentPhone);
}
}
});
代码示例来源:origin: com.squareup.assertj/assertj-android
public TelephonyManagerAssert hasVoiceMailNumber(String number) {
isNotNull();
String actualNumber = actual.getVoiceMailNumber();
assertThat(actualNumber) //
.overridingErrorMessage("Expected voice mail number <%s> but was <%s>.", number,
actualNumber) //
.isEqualTo(number);
return this;
}
代码示例来源:origin: geniusgithub/AndroidDialer
/**
* Return the voicemail number for a given phone account.
*
* @param telecomManager The {@link TelecomManager} object to use for retrieving the voicemail
* number if accountHandle is specified.
* @param telephonyManager The {@link TelephonyManager} object to use for retrieving the
* voicemail number if accountHandle is null.
* @param accountHandle The handle for the phone account.
* @return The voicemail number for the phone account, and {@code null} if one has not been
* configured.
*/
@Nullable
public static String getVoiceMailNumber(@Nullable TelecomManager telecomManager,
@Nullable TelephonyManager telephonyManager,
@Nullable PhoneAccountHandle accountHandle) {
if (telecomManager != null && (CompatUtils.isMethodAvailable(
TELECOM_MANAGER_CLASS, "getVoiceMailNumber", PhoneAccountHandle.class))) {
return telecomManager.getVoiceMailNumber(accountHandle);
} else if (telephonyManager != null){
return telephonyManager.getVoiceMailNumber();
}
return null;
}
代码示例来源:origin: luhaoaimama1/zone-sdk
sb.append("\ngetSimState :").append(tm.getSimState());
sb.append("\nSubscriberId :").append(tm.getSubscriberId());
sb.append("\nVoiceMailNumber :").append(tm.getVoiceMailNumber());
代码示例来源:origin: Leeii/LeeFream
sb.append("\ngetSimState :").append(tm.getSimState());
sb.append("\nSubscriberId :").append(tm.getSubscriberId());
sb.append("\nVoiceMailNumber :").append(tm.getVoiceMailNumber());
代码示例来源:origin: huangweicai/OkLibDemo
sb.append("\ngetSimState :").append(tm.getSimState());
sb.append("\nSubscriberId :").append(tm.getSubscriberId());
sb.append("\nVoiceMailNumber :").append(tm.getVoiceMailNumber());
代码示例来源:origin: geniusgithub/AndroidDialer
/**
* Check if voicemail is enabled/accessible.
*
* @return true if voicemail is enabled and accessible. Note that this can be false
* "temporarily" after the app boot.
*/
private boolean isVoicemailAvailable() {
try {
PhoneAccountHandle defaultUserSelectedAccount =
TelecomUtil.getDefaultOutgoingPhoneAccount(getActivity(),
PhoneAccount.SCHEME_VOICEMAIL);
if (defaultUserSelectedAccount == null) {
// In a single-SIM phone, there is no default outgoing phone account selected by
// the user, so just call TelephonyManager#getVoicemailNumber directly.
return !TextUtils.isEmpty(getTelephonyManager().getVoiceMailNumber());
} else {
return !TextUtils.isEmpty(TelecomUtil.getVoicemailNumber(getActivity(),
defaultUserSelectedAccount));
}
} catch (SecurityException se) {
// Possibly no READ_PHONE_STATE privilege.
Log.w(TAG, "SecurityException is thrown. Maybe privilege isn't sufficient.");
}
return false;
}
代码示例来源:origin: stackoverflow.com
int simState = telephonyManager.getSimState();
String voicemailNumer = telephonyManager.getVoiceMailNumber();
String voicemailAlphaTag = telephonyManager.getVoiceMailAlphaTag();
代码示例来源:origin: stackoverflow.com
int simState = telephonyManager.getSimState();
String voicemailNumer = telephonyManager.getVoiceMailNumber();
String voicemailAlphaTag = telephonyManager.getVoiceMailAlphaTag();
代码示例来源:origin: stackoverflow.com
.getVoiceMailNumber())
+ "\n\tIsNetworkRoaming ="
代码示例来源:origin: stackoverflow.com
//Get the instance of TelephonyManager
TelephonyManager tm=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
//Calling the methods of TelephonyManager the returns the information
String IMEINumber=tm.getDeviceId();
String subscriberID=tm.getDeviceId();
String SIMSerialNumber=tm.getSimSerialNumber();
String networkCountryISO=tm.getNetworkCountryIso();
String SIMCountryISO=tm.getSimCountryIso();
String softwareVersion=tm.getDeviceSoftwareVersion();
String voiceMailNumber=tm.getVoiceMailNumber();
//Get the phone type
String strphoneType="";
int phoneType=tm.getPhoneType();
switch (phoneType)
{
case (TelephonyManager.PHONE_TYPE_CDMA):
strphoneType="CDMA";
break;
case (TelephonyManager.PHONE_TYPE_GSM):
strphoneType="GSM";
break;
case (TelephonyManager.PHONE_TYPE_NONE):
strphoneType="NONE";
break;
}
代码示例来源:origin: hoangkien0705/Android-UtilCode
str += "SimState = " + tm.getSimState() + "\n";
str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
return str;
代码示例来源:origin: lianghuiyong/AndroidBase
str += "SimState = " + tm.getSimState() + "\n";
str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
return str;
代码示例来源:origin: yaozs/YzsLib
str += "SimState = " + tm.getSimState() + "\n";
str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
return str;
代码示例来源:origin: 0xm1nam0/RxCore
str += "SimState = " + tm.getSimState() + "\n";
str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
return str;
代码示例来源:origin: xiaolongonly/Ticket-Analysis
str += "SimState = " + tm.getSimState() + "\n";
str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
return str;
内容来源于网络,如有侵权,请联系作者删除!