我想检查用户是否在他/她的设备上启用了背景数据,并在禁用时显示消息.
如何检查是否已启用?
我试过了
但他们正在返回null.
谢谢,
的政绩.
解决方法
您想使用
Connectivity Manager来获取此信息.
@H_301_5@ConnectivityManager mgr = (ConnectivityManager)Context.getSystemService(Context.CONNECTIVITY_SERVICE);
boolean bgData = mgr.07001;