@Override
  public void onReceive(Context context, Intent intent) {
    final App app = (App) context.getApplicationContext();

    if (!app.isEnabled()) {
      return;
    }

    app.onConnectivityChanged();
  }
Exemplo n.º 2
0
  public void updateInstallStatus() {
    PreferenceScreen screen = this.getPreferenceScreen();
    int numPrefs = screen.getPreferenceCount();

    String basePackageName = app.getPackageName();

    this.setTitle(
        getText(R.string.expansion_packs_title) + " (" + app.getOutgoingMessageLimit() + ")");

    for (int i = 0; i < numPrefs; i++) {
      Preference p = screen.getPreference(i);

      String packageNum = p.getKey();

      String packageName = basePackageName + "." + packageNum;

      if (app.isSmsExpansionPackInstalled(packageName)) {
        p.setSummary("Installed.");
      } else {
        p.setSummary("Not installed.\nInstall to increase limit by 100 SMS/hour...");
      }
    }
  }