Hi Umer,
 Use this method

private boolean isNetworkAvailable() {
    ConnectivityManager connectivityManager
          = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo activeNetworkInfo =
connectivityManager.getActiveNetworkInfo();
    return activeNetworkInfo != null;
}


and add this one in manifest  file
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" />

Thanks and Regards,
S.Seshu

On Feb 23, 12:26 pm, "[email protected]"
<[email protected]> wrote:
> Hi,
>     My app is depends on internet, so I want that if the mobile is not
> connected to internet then my app show the message to the user that
> "internet not connected" and exit the application. give me any
> suggestion.
>
> Thanks and Regards,
>
> umer

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to