Why are you using onClickListener for Spinner? You must use OnItemSelectedListener () for Spinner, see the code example below,
public class MySpinnerSelectedListener implements OnItemSelectedListener {
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
String selected = parent.getItemAtPosition(pos).toString();
}
public void onNothingSelected(AdapterView parent) {
}
}
Now register the listener using the following code,
spinner.setOnItemSelectedListener(new MySpinnerSelectedListener());
You can pass it using the following code,
// Submit code
Intent intent = new Intent(getApplicationContext(), DatabaseResult.class);
intent.putextra("getData",USN.toString());
startActivity(intent);
// Get the code,
String value= getIntent().getStringExtra("getData");
source
share