0
I have this method to check if the device is connected. However I am getting some msgs of problems with synchronization of my data. And I’m thinking it must have been this alteration in the Internet verification method. I am not experienced, so I preferred to ask if there is something wrong or missing in this method. Thank you.
public static boolean isNetworkAvailable (Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected() && activeNetworkInfo.isAvailable();
}
I’ll test with some things you sent, to see if it solves the problem. Thank you.
– Joaohesilva