Я пытаюсь создать динамический счетчик (выпадающий список), но не могу заставить его работать, он показывает первый элемент в счетчике, но когда я нажимаю на него, список с другими элементами не отображаетсяи ничего не происходит.
Моя деятельность xml:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="80dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:orientation="horizontal">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/global_languages"/>
<Spinner
android:id="@+id/localesSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:popupBackground="@color/facebookBlue"
android:clickable="true"/>
</LinearLayout>
Я пытаюсь настроить элементы следующим образом:
private void loadLocalesSuccess(Collection<String> locales){
Spinner localesSpinner = (Spinner) findViewById(R.id.localesSpinner);
ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, new ArrayList(locales));
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
localesSpinner.setAdapter(adapter);
adapter.notifyDataSetChanged();
}
в чем может быть проблема?