Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试检测设备是否在我的应用程序中漫游,我发现了这两种方法:
它们之间有本质区别还是我可以选择一个?
我认为TelephonyManager.isNetworkRoaming()与 2G 相关,是否NetworkInfo.isRoaming()与 3G 相关 - 设置数据漫游开/关是 android-settings 中的一个独特选项,所以如果它关闭,你仍然可以true使用 GSM ( TelephonyManager.isNetworkRoaming())
TelephonyManager.isNetworkRoaming()
NetworkInfo.isRoaming()
true