im building an app that has self destructing images and i am trying to pass the value selected from the spinner to another class
final String titles[] = {"1 Second","2 Seconds", "3 Seconds","4 Seconds","5 Seconds","6 Seconds","7 Seconds", "8 seconds, "9 seconds", 10 seconds};
mSeconds = (Spinner) view.findViewById(R.id.secondsSpinner);
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_item, titles);
arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mSeconds.setAdapter(arrayAdapter);
mSeconds.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
int secondsToUse = position + 1;
}
@Override
public void onNothingSelected(AdapterView<?> parentView) {
// do nothing
}
});
my intent method:
Intent recipientsIntent = new Intent(getActivity(), RecipientsActivity.class);
recipientsIntent.putExtra("key1", titles);
startActivity(recipientsIntent);
how can i pass the value selected to another class? my method passes the whole array not the item selected.