Open iman2420 opened 5 years ago
How to set listener? its listener always null!
` public void setOnSearchableItemSelectedListener(OnSearchableItemSelectedListener listener) { this.mListener = listener; } public interface OnSearchableItemSelectedListener { void OnSearchableItemSelected(Object item, int position); } private OnSearchableItemSelectedListener mListener; @Override public void onSearchableItemClicked(Object item, int position) { setSelection(_items.indexOf(item)); if (mListener != null) mListener.OnSearchableItemSelected(item, position); if (!_isDirty) { _isDirty = true; setAdapter(_arrayAdapter); setSelection(_items.indexOf(item)); } }`
And in Activity :
partGroupSpinner.setOnSearchableItemSelectedListener((item, position) -> { Toast.makeText(PartListActivity.this, "OnSearchableItemSelected " + position, Toast.LENGTH_LONG).show(); });
How to set listener? its listener always null!
And in Activity :