Hi, I try to check network connectivity and Internet present by using following method
check = new ConnectionDetector(getApplicationContext());
You can't make HTTP requests on the main thread, it would cause the UI to freeze up. So it throws that exception. You need to do it in an AsyncTask or another Thread.