Re: [android-developers] Avoiding onItemSelected calls during initialization

2012-05-25 Thread IronBlossom
*Your event handler doesn't run during initialization. It runs on the** first layout* New to android. Facing the same problem on spinner, but what do you mean by first layout? Is there any relationship with XML layout or you mean the first spinner.setOnItemSelectedListener(null)? --

[android-developers] Avoiding onItemSelected calls during initialization

2008-11-22 Thread Dave Orme
I have code like: void init() { spinner.setOnItemSelectedListener(null); spinner.setAdapter(prioritiesAdapter); spinner.setSelection(task.getPriority() - 1); spinner.setOnItemSelectedListener(this); } @Override public void onItemSelected(AdapterView? parent, View v, int position, long