title: Android application without GUI
body: <p>I have been developing a simple application without UI using broadcast receiver. </p>
  
  <p>The app doesn't contain any ACTIVITIES.</p>
  
  <p>I have given necessary permissions.</p>
  
  <p>I took the code from this url:<a href="http://developerandro.blogspot.in/2013/09/check-internet-connection-using.html" rel="nofollow">http://developerandro.blogspot.in/2013/09/check-internet-connection-using.html</a></p>
  
  <p>The app shows a toast "Not connected to internet" when I click change wifi state. It's working correctly.</p>
  
  <p>But my question is There is an activity registered in my manifest file which I don't have. So I delete those lines from my manifest. Then no toasts are shown and I checked the logs too. No output on changing wifi state.</p>
  
  <p>Why this happened? Please help me guys...</p>
  
  <p>Here is the manifest file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.broadcast_internetcheck"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="17" /&gt;
  
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.example.broadcast_internetcheck.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;receiver
              android:name="com.example.broadcast_internetcheck.NetworkChangeReceiver"
              android:label="NetworkChangeReceiver" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.net.conn.CONNECTIVITY_CHANGE" /&gt;
                  &lt;action android:name="android.net.wifi.WIFI_STATE_CHANGED" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Here is my Broadcastreceiver class:</p>
  
  <pre><code>public class NetworkChangeReceiver extends BroadcastReceiver{
  
    @Override
       public void onReceive(final Context context, final Intent intent) {
  
           String status = NetworkUtil.getConnectivityStatusString(context);
            /*Above line will return the status of wifi */
           Toast.makeText(context, status, Toast.LENGTH_LONG).show();
  
       }
  }
  </code></pre>