jau*_*ard 0 networking android listen 3g
我知道如何知道网络类型:
TelephonyManager telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
int network_type = telManager.getNetworkType();
Run Code Online (Sandbox Code Playgroud)
但我希望在手机切换到2G到3G或3G到2G时注册...
无论如何要做到这一点?
谢谢你的帮助.问候吉姆
您应该使用PhoneStateListener类.他包含方法onDataConnectionStateChanged (int state, int networkType).
希望它的帮助.