Beispiel #1
0
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    switch (requestCode) {
      case REQUEST_PREFS:
        // The automatic update settings may have changed, so reschedule (or
        // unschedule) the service accordingly. It's cheap, so no need to
        // check if the particular setting has actually been changed.
        UpdateService.schedule(getBaseContext());

        if ((resultCode & PreferencesActivity.RESULT_RESTART) != 0) {
          ((FDroidApp) getApplication()).reloadTheme();
          final Intent intent = getIntent();
          overridePendingTransition(0, 0);
          intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
          finish();
          overridePendingTransition(0, 0);
          startActivity(intent);
        }
        break;
      case REQUEST_ENABLE_BLUETOOTH:
        fdroidApp.sendViaBluetooth(this, resultCode, "org.fdroid.fdroid");
        break;
    }
  }
Beispiel #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {

    fdroidApp = (FDroidApp) getApplication();
    fdroidApp.applyTheme(this);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.fdroid);
    createViews();

    getTabManager().createTabs();

    // Start a search by just typing
    setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);

    Intent intent = getIntent();
    handleSearchOrAppViewIntent(intent);

    if (intent.hasExtra(EXTRA_TAB_UPDATE)) {
      boolean showUpdateTab = intent.getBooleanExtra(EXTRA_TAB_UPDATE, false);
      if (showUpdateTab) {
        getTabManager().selectTab(2);
      }
    }

    Uri uri = AppProvider.getContentUri();
    getContentResolver().registerContentObserver(uri, true, new AppObserver());

    InstallExtensionDialogActivity.firstTime(this);

    // Re-enable once it can be disabled via a setting
    // See https://gitlab.com/fdroid/fdroidclient/issues/435
    //
    // if (UpdateService.isNetworkAvailableForUpdate(this)) {
    //     UpdateService.updateNow(this);
    // }
  }