title: java.lang.InstantiationException: class has no zero argument constructor
body: <p>I am trying to use a <code>BroadcastReceiver</code> as an <strong>inner class</strong> to track the network state but I got the exception in the title.  What should I do to fix this problem?   </p>
  
  <pre><code>public class NetworkChangeReceiver extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
          final ConnectivityManager connMgr = (ConnectivityManager) context
                  .getSystemService(Context.CONNECTIVITY_SERVICE);
  
          final android.net.NetworkInfo wifi = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
          final android.net.NetworkInfo mobile = connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
  
          if (wifi.isAvailable() || mobile.isAvailable()) {
              setupData();
              Log.d("Netowk Available ", "Flag No 1");
          }
      }
  }
  </code></pre>