Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7898911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:33:49+00:00 2026-06-03T08:33:49+00:00

I need to check whether internet is available or not in Android, so I

  • 0

I need to check whether internet is available or not in Android, so I have tried using the following function:

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

And I also added the required permissions in the manifest:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

But it still throws exceptions:

05-02 16:05:26.226: E/AndroidRuntime(481): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.housedisplay/com.housedisplay.RssActivity}: java.lang.SecurityException: ConnectivityService: Neither user 10038 nor current process has android.permission.ACCESS_NETWORK_STATE.
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.app.ActivityThread.access$1500(ActivityThread.java:123)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.os.Looper.loop(Looper.java:126)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.app.ActivityThread.main(ActivityThread.java:3997)
05-02 16:05:26.226: E/AndroidRuntime(481):  at java.lang.reflect.Method.invokeNative(Native Method)
05-02 16:05:26.226: E/AndroidRuntime(481):  at java.lang.reflect.Method.invoke(Method.java:491)
05-02 16:05:26.226: E/AndroidRuntime(481):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
05-02 16:05:26.226: E/AndroidRuntime(481):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
05-02 16:05:26.226: E/AndroidRuntime(481):  at dalvik.system.NativeStart.main(Native Method)
05-02 16:05:26.226: E/AndroidRuntime(481): Caused by: java.lang.SecurityException: ConnectivityService: Neither user 10038 nor current process has android.permission.ACCESS_NETWORK_STATE.
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.os.Parcel.readException(Parcel.java:1322)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.os.Parcel.readException(Parcel.java:1276)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.net.IConnectivityManager$Stub$Proxy.getActiveNetworkInfo(IConnectivityManager.java:446)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:256)
05-02 16:05:26.226: E/AndroidRuntime(481):  at com.housedisplay.RssActivity.isNetworkAvailable(RssActivity.java:218)
05-02 16:05:26.226: E/AndroidRuntime(481):  at com.housedisplay.RssActivity.onCreate(RssActivity.java:59)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
05-02 16:05:26.226: E/AndroidRuntime(481):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)

Can you tell me what’s happening over here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:33:50+00:00Added an answer on June 3, 2026 at 8:33 am

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" > is missing an end slash. Might cause problems parsing the XML, which could cause the next <uses-permission ...> to not parse correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to check whether a css file is available or - if not
I have the following code where I need to check whether the attribute in
I need to check whether a page is being redirected or not without actually
I need to check whether a URL (represented by a NSURL) is available or
I need to check whether a string contains any swear words. Following some advice
I have a web application inside where i need to check whether the user
I have a path like C:\application\photo\gallery\sketches . Now I need to check whether this
I need to check whether or not an administrative script is already running on
I am using a third party shared library and I need to check whether
I have an application wherein the application will need to check whether one user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.