示例#1
0
  @Override
  protected void onResume() {
    super.onResume();
    if (mUtility.isValidSubId()) {
      UnLockSubDialog.showDialog(this, mUtility.getSubId(), CellConnMgr.STATE_SIM_LOCKED);
    }
    if (mPhone != null) {
      updatePreference();

      updateSignalStrength(mPhone.getSignalStrength());
      updateServiceState(mPhone.getServiceState());
      updateDataState();
      mTelephonyManager.listen(
          mPhoneStateListener,
          PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
              | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
              | PhoneStateListener.LISTEN_SERVICE_STATE);
      if (mShowLatestAreaInfo) {
        registerReceiver(
            mAreaInfoReceiver,
            new IntentFilter(CB_AREA_INFO_RECEIVED_ACTION),
            CB_AREA_INFO_SENDER_PERMISSION,
            null);
        // Ask CellBroadcastReceiver to broadcast the latest area info received
        Intent getLatestIntent = new Intent(GET_LATEST_CB_AREA_INFO_ACTION);
        sendBroadcastAsUser(getLatestIntent, UserHandle.ALL, CB_AREA_INFO_SENDER_PERMISSION);
      }
    }
  }
  @SuppressWarnings("deprecation")
  @Override
  public void onResume() {
    super.onResume();
    if (D) Log.d(TAG, "onResume");

    root = getPreferenceManager().createPreferenceScreen(context);
    setPreferenceScreen(root);
    if (Build.VERSION.SDK_INT < 11)
      getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_launcher);

    Preference p_setting = new Preference(context);
    p_setting.setTitle(res.getString(R.string.accountsandsyncs_title));
    p_setting.setSummary(res.getString(R.string.accountsandsyncs_summary));
    p_setting.setOnPreferenceClickListener(
        new OnPreferenceClickListener() {
          public boolean onPreferenceClick(Preference preference) {
            startActivity(new Intent(Settings.ACTION_SYNC_SETTINGS));
            return false;
          }
        });
    root.addPreference(p_setting);

    //

    new AccountsTask().execute();
  }
示例#3
0
  @Override
  protected void onResume() {
    super.onResume();

    if (mPhone != null && !Utils.isWifiOnly(getApplicationContext())) {
      mPhoneStateReceiver.registerIntent();

      updateSignalStrength();
      updateServiceState(mPhone.getServiceState());
      updateDataState();
      mTelephonyManager.listen(
          mPhoneStateListener, PhoneStateListener.LISTEN_DATA_CONNECTION_STATE);
      if (mShowLatestAreaInfo) {
        registerReceiver(
            mAreaInfoReceiver,
            new IntentFilter(CB_AREA_INFO_RECEIVED_ACTION),
            CB_AREA_INFO_SENDER_PERMISSION,
            null);
        // Ask CellBroadcastReceiver to broadcast the latest area info received
        Intent getLatestIntent = new Intent(GET_LATEST_CB_AREA_INFO_ACTION);
        sendBroadcastAsUser(getLatestIntent, UserHandle.ALL, CB_AREA_INFO_SENDER_PERMISSION);
      }
    }
    registerReceiver(mBatteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
    mHandler.sendEmptyMessage(EVENT_UPDATE_STATS);
  }
  @TargetApi(Build.VERSION_CODES.HONEYCOMB)
  @Override
  protected void onResume() {
    super.onResume();

    getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
  }
 @SuppressWarnings("deprecation")
 @Override
 protected void onResume() {
   super.onResume();
   getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(listener);
   findPreference("ringtone_key").setOnPreferenceChangeListener(new RingtoneChangeListener());
 }
  @Override
  protected void onResume() {
    super.onResume();
    Log.v(TAG, "onResume()");

    WifiReceiver.initWifiSetting(this);
  }
  @Override
  protected void onResume() {
    PreferenceScreen pref_root = getPreferenceManager().createPreferenceScreen(this);

    SharedPreferences config = getSharedPreferences(getPackageName(), MODE_WORLD_READABLE);
    String tunnels = config.getString("tunnels", "");
    List<String> tunnels_list = Arrays.asList(tunnels.split("\n"));
    for (String tunnel : tunnels_list) {
      if (tunnel.length() == 0) continue;
      String remote_server =
          config.getString(String.format("tunnels.%s.remote_server", tunnel), "0.0.0.0");
      String local_client =
          config.getString(String.format("tunnels.%s.local_client", tunnel), "0.0.0.0");
      boolean config_autodetect =
          config.getBoolean(String.format("tunnels.%s.local_autodetect", tunnel), false);
      if (config_autodetect) {
        local_client = "<dynamic>";
      }
      String tunnel_address =
          config.getString(String.format("tunnels.%s.tunnel_address", tunnel), "::0/0");

      Preference pref = new Preference(this);
      pref.setKey(tunnel);
      pref.setTitle(String.format("%s - %s", local_client, remote_server));
      pref.setSummary(tunnel_address);
      pref.setOnPreferenceClickListener(new TunnelPreferenceListener(this));
      pref_root.addPreference(pref);
    }

    setPreferenceScreen(pref_root);

    super.onResume();
  }
 protected void onResume() {
   super.onResume();
   registerReceiver(mReceiver, mIntentFilter);
   mNamePreference.resume();
   mEnablerPreference.resume();
   setScreenState();
 }
  @Override
  protected void onResume() {
    super.onResume();

    // Repopulate (which isn't too bad since it's cached in the settings
    // bluetooth manager
    addDevices();

    if (mScreenType == SCREEN_TYPE_SETTINGS) {
      mEnabler.resume();
      mDiscoverableEnabler.resume();
      mNamePreference.resume();
    }

    mLocalManager.registerCallback(this);

    mDeviceList.setProgress(mLocalManager.getBluetoothAdapter().isDiscovering());
    mLocalManager.startScanning(false);

    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
    intentFilter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
    registerReceiver(mReceiver, intentFilter);
    mLocalManager.setForegroundActivity(this);
  }
 @Override
 protected void onResume() {
   super.onResume();
   findPreference(KEY_CALL_SETTINGS)
       .setEnabled(
           !AirplaneModeEnabler.isAirplaneModeOn(this) || SipManager.isVoipSupported(this));
 }
  @Override
  protected void onResume() {
    super.onResume();

    // Registers a callback to be invoked whenever a user changes a preference.
    getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
  }
示例#12
0
  @Override
  protected void onResume() {
    super.onResume();
    // check if the full screen mode should be activated
    if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("fullscreen", false)) {
      getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
      getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    } else {
      getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
      getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    }

    // sets the currently selected filename if available
    Preference source = findPreference("mapsforge_background_type");
    final String filePath =
        PreferenceManager.getDefaultSharedPreferences(getBaseContext())
            .getString(MapView.MAPSFORGE_BACKGROUND_FILEPATH, null);
    if (filePath != null) {
      if (filePath.contains("/")) {
        source.setSummary(filePath.substring(filePath.lastIndexOf("/") + 1));
      } else {
        source.setSummary(filePath);
      }
    }
  }
  @Override
  public void onResume() {
    super.onResume();
    mConf.onResume();

    mPrefs.registerOnSharedPreferenceChangeListener(this);
  }
 @Override
 protected void onResume() {
     super.onResume();
     PreferenceManager
             .getDefaultSharedPreferences(this)
             .registerOnSharedPreferenceChangeListener(this);
 }
  @Override
  protected void onResume() {
    super.onResume();

    // Set up a listener whenever a key changes
    getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
  }
  @Override
  protected void onResume() {
    super.onResume();

    // need to set sync account automatically if user has added a new
    // account
    if (mHasAddedAccount) {
      Account[] accounts = getGoogleAccounts();
      if (mOriAccounts != null && accounts.length > mOriAccounts.length) {
        for (Account accountNew : accounts) {
          boolean found = false;
          for (Account accountOld : mOriAccounts) {
            if (TextUtils.equals(accountOld.name, accountNew.name)) {
              found = true;
              break;
            }
          }
          if (!found) {
            setSyncAccount(accountNew.name);
            break;
          }
        }
      }
    }

    refreshUI();
  }
  @Override
  protected void onResume() {
    super.onResume();

    loadPairedBTDevices();
    loadSetPreferences();
  }
 @Override
 protected void onResume() {
   super.onResume();
   IntentFilter filter = new IntentFilter();
   filter.addAction(PROCESS_COMMAND_ACTION);
   registerReceiver(mReceiver, filter);
 }
 /*
  * (non-Javadoc)
  * @see android.app.Activity#onResume()
  */
 @Override
 @SuppressWarnings("deprecation")
 protected void onResume() {
   super.onResume();
   final PreferenceScreen preferenceScreen = getPreferenceScreen();
   final SharedPreferences sharedPreferences = preferenceScreen.getSharedPreferences();
   sharedPreferences.registerOnSharedPreferenceChangeListener(this);
 }
  @Override
  protected void onResume() {
    super.onResume();

    mWifiEnabler.resume();
    mAirplaneModeEnabler.resume();
    // mBtEnabler.resume();
  }
示例#21
0
  @Override
  public void onResume() {
    super.onResume();

    if (getApplication() instanceof GeckoApplication) {
      ((GeckoApplication) getApplication()).onActivityResume(this);
    }
  }
 @Override
 protected void onResume() {
   if (null != mCastManager) {
     mCastManager.incrementUiCounter();
     mCastManager.updateCaptionSummary("caption", getPreferenceScreen());
   }
   super.onResume();
 }
  @Override
  protected void onResume() {
    super.onResume();
    // TODO Auto-generated method stub
    if (!PreyStatus.getInstance().isPreyConfigurationActivityResume()) {
      Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      intent.putExtra("EXIT", true);
      try {
        startActivity(intent);
      } catch (Exception e) {
      }
      finish();
    }
    try {
      if (PreyEmail.getEmail(getApplicationContext()) != null) {
        PreferenceCategory mCategory = (PreferenceCategory) findPreference("PREFS_CAT_PREFS");
        Preference p2 = findPreference(PreyConfig.PREFS_SCHEDULED);
        mCategory.removePreference(p2);
      }
    } catch (Exception e) {
    }

    PreyConfig preyConfig = PreyConfig.getPreyConfig(getApplicationContext());
    Preference p = findPreference("PREFS_ADMIN_DEVICE");
    if (preyConfig.isFroyoOrAbove()) {

      if (FroyoSupport.getInstance(getApplicationContext()).isAdminActive()) {
        p.setTitle(R.string.preferences_admin_enabled_title);
        p.setSummary(R.string.preferences_admin_enabled_summary);
      } else {
        p.setTitle(R.string.preferences_admin_disabled_title);
        p.setSummary(R.string.preferences_admin_disabled_summary);
      }
    } else p.setEnabled(false);

    p = findPreference("PREFS_ABOUT");
    p.setSummary("Version " + preyConfig.getPreyVersion() + " - Prey Inc.");

    Preference pGo = findPreference("PREFS_GOTO_WEB_CONTROL_PANEL");
    pGo.setOnPreferenceClickListener(
        new Preference.OnPreferenceClickListener() {

          public boolean onPreferenceClick(Preference preference) {

            String url = PreyConfig.getPreyConfig(getApplicationContext()).getPreyPanelUrl();
            PreyLogger.d("url control:" + url);
            Intent internetIntent = new Intent(Intent.ACTION_VIEW);
            internetIntent.setData(Uri.parse(url));
            try {
              Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
              startActivity(intent);
            } catch (Exception e) {
            }
            return false;
          }
        });
  }
示例#24
0
  @Override
  public void onResume() {
    String temp;

    super.onResume();
    temp = getCurMode();
    mA2sdPref.setValue(temp);
    mA2sdPref.setSummary(String.format(mModeFormat, temp));
  }
  protected void onResume() {
    super.onResume();

    for (String preferenceKey : getPreferenceScreen().getSharedPreferences().getAll().keySet()) {
      setSummary(preferenceKey);
    }

    getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
  }
示例#26
0
  @Override
  public void onResume() {
    super.onResume();

    setOrientation(this);

    getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
    setSummaries();
  }
  @Override
  protected void onResume() {
    super.onResume();

    updateState(true);

    IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION);
    registerReceiver(mReceiver, filter);
  }
示例#28
0
  @Override
  protected void onResume() {
    // TODO Auto-generated method stub
    super.onResume();

    prefs = PreferenceManager.getDefaultSharedPreferences(this);
    String currentCityName = prefs.getString("cityName", getString(R.string.defaultCity));
    customPref.setSummary(getString(R.string.chosen) + currentCityName);
  }
  @Override
  protected void onResume() {
    super.onResume();

    // Do work for restoring saved prefs
    customCirrusPrefs = getSharedPreferences("customCirrusPrefs", Activity.MODE_PRIVATE);

    // Start polling for GPS information every 2 seconds
    locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 0, locListener);
  }
示例#30
0
 @Override
 protected void onResume() {
   super.onResume();
   mSim1Setting.setEnabled(PhoneFactory.isCardReady(0));
   mSim2Setting.setEnabled(PhoneFactory.isCardReady(1));
   mIpDailingOn.setChecked(mIpDailingUtils.getIsIpDial());
   mIpDailingPreference.setEnabled(mIpDailingOn.isChecked());
   mGsmButtonCallVibrate.setChecked(
       (defaultSharedpref == null ? true : defaultSharedpref.getBoolean(KEY_CALL_VIBRATE, true)));
 }