在android中检测CDMA手机上的漫游
在我的应用程序中,我想检测手机是否处于漫游状态。我看到TelephonyManager中有API在android中检测CDMA手机上的漫游,android,telephonymanager,Android,Telephonymanager,在我的应用程序中,我想检测手机是否处于漫游状态。我看到TelephonyManager中有API TelephonyManager telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); telManager.isNetworkRoaming(); 但这里的文件上写着“用于GSM目的”。这是否意味着此API将在CDMA网络上失败 谢谢。我只是担心文档中的“GSM应用程序”评论。
TelephonyManager telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
telManager.isNetworkRoaming();
但这里的文件上写着“用于GSM目的”。这是否意味着此API将在CDMA网络上失败
谢谢。我只是担心文档中的“GSM应用程序”评论。我没有在cdma手机上测试过,试试吧
public class RoamingListener extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
TelephonyManager telephony =
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if (telephony.isNetworkRoaming())
Toast.makeText(context, "Is on TelephonyM Roaming", Toast.LENGTH_LONG).show();
}
}