Skip to content Skip to sidebar Skip to footer

Check Whether Its Connected Or Not

The logcat output is this.. 01-30 06:34:43.633: D/AndroidRuntime(1228): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<

Solution 1:

remove

 private Activity context;

and everywhere when you are using it, also remove it. For instance change

 context.getSystemService(...

to just

  getSystemService(...

your MainActivity is already a Context, and that is what you need. You created context field, but is is null, and anyways that wont work since you need a context created by the systems. and that is what your activity is.


Solution 2:

Add internet permission...

    <!-- Internet Permissions -->
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- Network State Permissions -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Post a Comment for "Check Whether Its Connected Or Not"