Android Open Source - VO-Miner Mineral Search Activity






From Project

Back to project page VO-Miner.

License

The source code is released under:

GNU General Public License

If you think the Android project VO-Miner listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.uruwolf.vominer;
//from  w  w w.  j a  v a2s. c  om
import com.uruwolf.vominer.data.Static;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;

/**
 * Allows the user to select a mineral to search for.
 * @author Steve "Uru" West <uruwolf@gmail.com>
 *
 */
public class MineralSearchActivity extends Activity implements OnClickListener{

  @Override
  public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mineral_search);
    
    //Set up the spinner to show the list of minerals
    Spinner systemSpinner = (Spinner) findViewById(R.id.mineralSearchList);
        ArrayAdapter<String> systemAdapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1,
                Static.mineralList);
        systemAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        systemSpinner.setAdapter(systemAdapter);
        
        //Make sure the button will do something when pressed
        ((Button) findViewById(R.id.mineralSeachButton)).setOnClickListener(this);
  }

  public void onClick(View v) {
    Intent intent = new Intent(this, SectorListActivity.class);
    intent.putExtra("mineral", (String) ((Spinner)findViewById(R.id.mineralSearchList)).getSelectedItem());
    startActivity(intent);
    //hide the search away now we are done with it
    finish();
  }
}




Java Source Code List

com.uruwolf.vominer.MineralSearchActivity.java
com.uruwolf.vominer.SectorListActivity.java
com.uruwolf.vominer.SectorNotesActivity.java
com.uruwolf.vominer.VoMinerActivity.java
com.uruwolf.vominer.data.Mineral.java
com.uruwolf.vominer.data.SQLiteHelper.java
com.uruwolf.vominer.data.SectorDataSource.java
com.uruwolf.vominer.data.Sector.java
com.uruwolf.vominer.data.Static.java