@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final Intent intent = getIntent();
    mFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
    mFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);

    mAutoFinishOnConnection = intent.getBooleanExtra(EXTRA_AUTO_FINISH_ON_CONNECT, false);
    mIsNetworkRequired = intent.getBooleanExtra(EXTRA_IS_NETWORK_REQUIRED, false);
    mIsWifiRequired = intent.getBooleanExtra(EXTRA_IS_WIFI_REQUIRED, false);
    // Behave like the user already selected a network if we do not require selection
    mUserSelectedNetwork = !intent.getBooleanExtra(EXTRA_REQUIRE_USER_NETWORK_SELECTION, false);
  }
 @Override
 protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
   resid = SetupWizardUtils.getTheme(getIntent());
   super.onApplyThemeResource(theme, resid, first);
 }
 @Override
 public void onPause() {
   unregisterReceiver(mReceiver);
   super.onPause();
 }
 @Override
 public void onResume() {
   super.onResume();
   registerReceiver(mReceiver, mFilter);
   refreshConnectionState();
 }
 @Override
 protected void onRestoreInstanceState(Bundle savedInstanceState) {
   super.onRestoreInstanceState(savedInstanceState);
   mUserSelectedNetwork = savedInstanceState.getBoolean(PARAM_USER_SELECTED_NETWORK, true);
 }
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putBoolean(PARAM_USER_SELECTED_NETWORK, mUserSelectedNetwork);
 }