Android internet connectivity check problem

If the crash is directly on your line:

return cm.getActiveNetworkInfo().isConnectedOrConnecting();

then that means getActiveNetworkInfo() returned null, because there is no active network — in that case, your isConnected() method should return false.

Leave a Comment