public void updateSettings() {
    sp_sellto_system.setOnItemSelectedListener(null);
    sp_buyfrom_system.setOnItemSelectedListener(null);

    Task.Market req = EveDatabase.getDefaultRequiredPrice();
    Task.Market prod = EveDatabase.GetDefaultProducedPrice();

    if (req.order == Task.Market.Order.BUY) {
      rg_buyfrom_source.check(R.id.rb_buyfrom_buy);
    } else {
      rg_buyfrom_source.check(R.id.rb_buyfrom_sell);
    }
    if (prod.order == Task.Market.Order.BUY) {
      rg_sellto_source.check(R.id.rb_sellto_buy);
    } else {
      rg_sellto_source.check(R.id.rb_sellto_sell);
    }
    updateSystem(sp_sellto_system, prod.system);
    updateSystem(sp_buyfrom_system, req.system);

    sp_sellto_system.setOnItemSelectedListener(new SystemSelectedListener(false));
    sp_buyfrom_system.setOnItemSelectedListener(new SystemSelectedListener(true));
    ed_default_me.setValue(EveDatabase.getDefaultME(null));
    ed_default_te.setValue(EveDatabase.getDefaultTE(null));
  }
  private void updateSettings() {
    sp_sellto_system.setOnItemSelectedListener(null);
    sp_buyfrom_system.setOnItemSelectedListener(null);

    Market req = database.getDefaultRequiredMarket();
    Market prod = database.getDefaultProducedMarket();

    if (req.order == Market.Order.BUY) {
      rg_buyfrom_source.check(R.id.rb_buyfrom_buy);
    } else {
      rg_buyfrom_source.check(R.id.rb_buyfrom_sell);
    }
    if (prod.order == Market.Order.BUY) {
      rg_sellto_source.check(R.id.rb_sellto_buy);
    } else {
      rg_sellto_source.check(R.id.rb_sellto_sell);
    }
    updateSystem(sp_sellto_system, prod.system);
    updateSystem(sp_buyfrom_system, req.system);

    ed_sellto_broker.setValue(prod.broker);
    ed_sellto_tax.setValue(prod.transaction);
    ed_buyfrom_broker.setValue(req.broker);
    ed_buyfrom_tax.setValue(req.transaction);

    sp_sellto_system.setOnItemSelectedListener(new SystemSelectedListener(false));
    sp_buyfrom_system.setOnItemSelectedListener(new SystemSelectedListener(true));
    ed_default_me.setValue(database.getDefaultME(null));
    ed_default_te.setValue(database.getDefaultTE(null));
  }