check connection available or not in android.
public static boolean isNetworkAvailable(Context cont) { ConnectivityManager connectivityManager = (ConnectivityManager)cont. getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null && activeNetworkInfo.isConnected(); } and check this in- if(isNetworkAvailable(getApplicationContext())) { new Resiter().execute(); } else { Toast.makeText(getApplicationContext(), "Internet Unavailable...Please connect to Internet",3000).show(); }