Example #1
0
  /**
   * Handles what to do when the add button is clicked. Namely adding the selected mineral to the
   * sector and updating the lists after.
   */
  public void onClick(View v) {
    Mineral mineral = new Mineral();
    String mineralName = (String) ((Spinner) findViewById(R.id.mineralList)).getSelectedItem();

    if (!mineralName.equals(emptyMineralString)) {
      mineral.setMineral(mineralName);

      data.addMineralToSector(currentSector, mineral);
      setMineralLists(currentSector);
    }
  }