代码如下:
[java]
public String getProvidersName()
{
String str = "N/A";
try
{
this.IMSI = this.telephonyManager.getSubscriberId();
System.out.println(this.IMSI);
if (this.IMSI.startsWith("46000"))
str = "中国移动"; break;
if (this.IMSI.startsWith("46002"))
str = "中国移动"; break ;
if (this.IMSI.startsWith("46001"))
str = "中国联通";
else if (this.IMSI.startsWith("46003"))
str = "中国电信";
}
catch (Exception localException)
{
localException.printStackTrace();
}
return str;
}
注意申明:
[java]
代码如下:
this.telephonyManager = ((TelephonyManager)paramContext.getSystemService("phone"));
就这么简单。。。。
一起学吧部分文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与一起学吧进行文章共享合作。