我需要从我的应用程序连接到 IMS apn。当我尝试连接到 IMS apn 时,它会在我的手机上连接和断开连接,即使在 kitkat 上使用 MMS 也会发生同样的情况。有人可以帮我解决这个问题。这是代码来自我在 oncreate 中的片段
private string REQUIRED_FEATURE = "enableIMS"; # also tried with "enableMMS"
ConnectionManager mConMgr = ((ConnectivityManager)getActivity()).getSystemSerivce(Context.CONNECTIVITY_SERVICE);
int result =.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, REQUIRED_FEATURE);
Log.d(TAG, "we got connected result id as : " + result);
NetworkInfo ntInfo = mConMgr.getActiveNetworkInfo();
if (ntInfo != null)
Log.d(TAG, "we now network what we requested :: " + ntInfo.getExtraInfo()
+ " :: network connection");
与此 apn 断开连接后,它会跳回默认 apn。从连接开始到希望默认发生在一分钟内。
查看我的日志,我发现了这些状态:已连接、已断开连接、原因已连接、链接属性已更改、数据已禁用。基本上试图连接到ims apn并需要发送数据