title: Broadcastreceiver components are not allowed to bind to services in android
body: <p>Here is what I am doing:</p>
  
  <pre><code>public void onReceive(Context context, Intent intent) {
          // TODO Auto-generated method stub
  
          ConnectivityManager conn = (ConnectivityManager) context
              .getSystemService(Context.CONNECTIVITY_SERVICE);
      NetworkInfo activeNetwork = conn.getActiveNetworkInfo();
      boolean isConnected = activeNetwork != null
              &amp;&amp; activeNetwork.isConnectedOrConnecting();
  
      if (isConnected == true) {
  
          // initChatHub();
           Intent serviceIntent = new Intent(context, ChatService.class);
          Toast.makeText(context, "Connected", 1000).show();
          serviceIntent.putExtras(intent);
          context.startService(serviceIntent);
          context.bindService(serviceIntent, mServiceConnection,
                  Context.BIND_AUTO_CREATE);
  
      } else {
          Toast.makeText(context, "Disconnected", 1000).show();
      }
  }
  </code></pre>
  
  <p>when network state change then application becomes crash when i data-connection off then there is no Error coming when data connection On then app becomes crash and this Exception coming please suggest me how to fix it.</p>
  
  <p><img src="https://i.stack.imgur.com/Q1rA7.png" alt="enter image description here"></p>