http - Android Internet Connection Crash -
my app connectioncheck before connecting html-website , parsing information code:
public boolean networkinfo(context context) { // netzwerk infos anzeigen if (context != null) { connectivitymanager mgr = (connectivitymanager) context .getsystemservice(context.connectivity_service); if (mgr != null) { boolean mobilenetwork = false; boolean wifinetwork = false; networkinfo mobileinfo = mgr .getnetworkinfo(connectivitymanager.type_mobile); networkinfo wifiinfo = mgr .getnetworkinfo(connectivitymanager.type_wifi); if (mobileinfo != null) mobilenetwork = mobileinfo.isconnected(); if (wifiinfo != null) wifinetwork = wifiinfo.isconnected(); return (mobilenetwork || wifinetwork); } } return false; } but during connection internet-state change , app doesn't receive requested information.
how can protect app crashing because of missing data? there checks connection whole time during thread running?
Comments
Post a Comment