我正在尝试检查手机中3G是否处于 Activity 状态,然后我必须启动一个Intent。
所以请有人帮帮我
提前致谢:)

最佳答案

我最近写的一篇应用文章的另一个摘要:

TelephonyManager telManager;
telManager = (TelephonyManager) getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
int cType = telManager.getNetworkType();
String cTypeString;
switch (cType) {
        case 1: cTypeString = "GPRS"; break;
        case 2: cTypeString = "EDGE"; break;
        case 3: cTypeString = "UMTS"; break;
        case 8: cTypeString = "HSDPA"; break;
        case 9: cTypeString = "HSUPA"; break;
        case 10:cTypeString = "HSPA"; break;
        default:cTypeString = "unknown"; break;
}

关于android - 如何在Android中检查3g是否处于 Activity 状态,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7511564/

10-09 21:04