开发者

Listen/register 2G 3G change on android

开发者 https://www.devze.com 2023-02-09 05:27 出处:网络
I know how know network type with : TelephonyManager telManager = (开发者_如何学CTelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

I know how know network type with :

TelephonyManager telManager = (开发者_如何学CTelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
int network_type = telManager.getNetworkType();

But I want to register when the phone switch into 2G to 3G or 3G to 2G...

Anyway to do this ?

Thanks for helping me. Regards Jim


You should use PhoneStateListener class. He contains method onDataConnectionStateChanged (int state, int networkType).

Hope its help.

0

精彩评论

暂无评论...
验证码 换一张
取 消