Multiselect is not multiselect , because when i choose one it's closing

i have multiselect spinner , but when i choose one the spinner has close. I want to choose several things. Here is my code :

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search);

    ArrayList<CategorySearch> categoriesList = new ArrayList<CategorySearch>();

    categorySpinner =(Spinner)findViewById(R.id.categorySpinner);
    subCategorySpinner = (Spinner)findViewById(R.id.subCategorySpinner);

    categoriesList = populateList();

    ArrayAdapter<CategorySearch> categoriesAdapter = new ArrayAdapter<CategorySearch>(this, android.R.layout.select_dialog_multichoice, categoriesList);
    categorySpinner.setAdapter(categoriesAdapter);

the list is closing when i choose one ... Thanks previously!

Upvotes: 1

Views: 126

Answers (1)

d.danailov
d.danailov

Reputation: 9810

Try with this (Android: Multiple Selection ListView) :

http://theopentutorials.com/tutorials/android/listview/android-multiple-selection-listview/

Upvotes: 1

Related Questions