错误:
NetworkSecurityConfig: No Network Security Config specified, using platform default.
答案 0 :(得分:1)
是旧的方法已被弃用你应该使用这个:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
registerReceiver(new ConnectionCheck(), new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
}