PROBLEM
My problem is that after changing data in my SpinnerArrayAdapter
my Spinner
does not react to item clicks on dropDownList
.
However after orientation change occurs everything is working fine(?!).
EDIT: I noticed it does catch the item clicks but not representing/showing it on Spinner
. Because after orientation change the selected item appears on Spinner
CONSTRUCTION
I have AutoCompleteTextView(ACTV)
that's connected to AutoCompleteAdapter implementing Filterable
. After entering some data into ACTV
the result is passed to SpinnerArrayAdapter
that is connected to Spinner
.
There is a customListener
set on AutoCompleteAdapter
that is connected to SpinnerArrayAdapter
and responsible for passing data between them.
Reason behind such construction is that user can have a 2-step choice. One on drop-down when choosing the data from ACTV
and second one in case he change his mind.
So you can put POSTCODE in the ACTV
select province that's connected to and change province when you miss-clicked/changed mind without forcing to enter POSTCODE again.
CODE
This is the part that is responsible for data change inside SpinnerArrayAdapter
.
@Override
public void setCitiesFromPostcode(ArrayList<String> cities) {
this.clear();
this.addAll(cities);
notifyDataSetChanged();
}