Hi, I am newbie and I have the following problem:
In activity A I populate a spinner from database and that is OK, but (automatic) follows a call with the first item in the spinner-population to:
sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
String item = sp.getSelectedItem().toString();
Toast.makeText(getApplicationContext(), item,
Toast.LENGTH_LONG).show();
Log.e("Item", item);
Intent i = new Intent(MainActivity.this, ZoekGemeente.class);
i.putExtra("gem", item);
startActivity(i);
}
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});
How can I avoid this. So I want to populate and wait for the user to make a choice. Then must follow this call.
Help is appreciated,
Ger.
In activity A I populate a spinner from database and that is OK, but (automatic) follows a call with the first item in the spinner-population to:
sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
String item = sp.getSelectedItem().toString();
Toast.makeText(getApplicationContext(), item,
Toast.LENGTH_LONG).show();
Log.e("Item", item);
Intent i = new Intent(MainActivity.this, ZoekGemeente.class);
i.putExtra("gem", item);
startActivity(i);
}
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});
How can I avoid this. So I want to populate and wait for the user to make a choice. Then must follow this call.
Help is appreciated,
Ger.
