在我的应用中,我想检测手机是否处于漫游状态。我看到TelephonyManager中有API
TelephonyManager telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
telManager.isNetworkRoaming();
但是这里的文档http://developer.android.com/reference/android/telephony/TelephonyManager.html#isNetworkRoaming%28%29说“出于GSM目的”。这是否意味着此API将在CDMA网络上失败?
感谢。
答案 0 :(得分:1)
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();
}
}