Hello Lex,
what do you mean with "it didn't work".
Didn't compile or didn't lead to awaited result

What was the error

With me it requires the following
imports to work:
Using java Syntax Highlighting
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
Parsed in 0.031 seconds, using
GeSHi 1.0.8.4
This is my full
working Code (no Compile-Errors):
Using java Syntax Highlighting
package org.anddev.android.testproject;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.AdapterView.OnItemSelectedListener;
public class TestLayout extends ListActivity {
@Override
public void onCreate(Bundle icicle){
super.onCreate(icicle);
TextView v = new TextView(this);
Spinner sp = new Spinner(this);
sp.setOnItemSelectedListener(new OnItemSelectedListener(){
@Override
public void onItemSelected(AdapterView parent, View v,
int position, long id) {
showAlert("Selection Changed...", "Position: " + position, "OK", false);
}
@Override
public void onNothingSelected(AdapterView arg0) {
}
});
this.setContentView(sp);
}
}
Parsed in 0.037 seconds, using
GeSHi 1.0.8.4
Regards,
plusminus