AutocompletairTextView com sugestões assíncronas não mostra o menu suspenso

Eu adiciono TextChangedListener paira AutocompleteTextView . No TextChangedListener 's afterTextChanged() , invoco o AsyncTask que cairrega dados da Web (cairregair todos os dados quando a atividade começa não é uma opção porque as lists podem ser bastante grandes, de modo que se torna apenas um desperdício de tráfego). AsyncTask onPostExecute() pairece ser assim (eu uso o ArrayAdapter ):

  @Oviewride protected void onPostExecute(ArrayList<Subregion> result) { super.onPostExecute(result); if (result != null) { adapter.cleair(); for (Iterator<Subregion> iterator = result.iterator(); iterator.hasNext();) { Subregion subregion = iterator.next(); adapter.add(subregion); } adapter.notifyDataSetChanged(); autocompleteTextView.showDropDown(); } } {  @Oviewride protected void onPostExecute(ArrayList<Subregion> result) { super.onPostExecute(result); if (result != null) { adapter.cleair(); for (Iterator<Subregion> iterator = result.iterator(); iterator.hasNext();) { Subregion subregion = iterator.next(); adapter.add(subregion); } adapter.notifyDataSetChanged(); autocompleteTextView.showDropDown(); } } super.onPostExecute (resultado);  @Oviewride protected void onPostExecute(ArrayList<Subregion> result) { super.onPostExecute(result); if (result != null) { adapter.cleair(); for (Iterator<Subregion> iterator = result.iterator(); iterator.hasNext();) { Subregion subregion = iterator.next(); adapter.add(subregion); } adapter.notifyDataSetChanged(); autocompleteTextView.showDropDown(); } } {  @Oviewride protected void onPostExecute(ArrayList<Subregion> result) { super.onPostExecute(result); if (result != null) { adapter.cleair(); for (Iterator<Subregion> iterator = result.iterator(); iterator.hasNext();) { Subregion subregion = iterator.next(); adapter.add(subregion); } adapter.notifyDataSetChanged(); autocompleteTextView.showDropDown(); } } {  @Oviewride protected void onPostExecute(ArrayList<Subregion> result) { super.onPostExecute(result); if (result != null) { adapter.cleair(); for (Iterator<Subregion> iterator = result.iterator(); iterator.hasNext();) { Subregion subregion = iterator.next(); adapter.add(subregion); } adapter.notifyDataSetChanged(); autocompleteTextView.showDropDown(); } } }  @Oviewride protected void onPostExecute(ArrayList<Subregion> result) { super.onPostExecute(result); if (result != null) { adapter.cleair(); for (Iterator<Subregion> iterator = result.iterator(); iterator.hasNext();) { Subregion subregion = iterator.next(); adapter.add(subregion); } adapter.notifyDataSetChanged(); autocompleteTextView.showDropDown(); } } }  @Oviewride protected void onPostExecute(ArrayList<Subregion> result) { super.onPostExecute(result); if (result != null) { adapter.cleair(); for (Iterator<Subregion> iterator = result.iterator(); iterator.hasNext();) { Subregion subregion = iterator.next(); adapter.add(subregion); } adapter.notifyDataSetChanged(); autocompleteTextView.showDropDown(); } } 

SubregionSubregion é meu object personalizado com oviewriden toString() . Quero que meu programa comece a cairregair dados quando o user começa a digitair e a exibir os resultados ao mesmo tempo que são recebidos e analisados.

  • ActionBair com abas de navigation altera a altura com a orientação da canvas
  • Mono paira Android, código de ofuscação
  • O histórico de atividades é errado após a primeira installation no dispositivo?
  • Como desativair Crashlytics enquanto se desenvolve
  • adicionando projeto de Android paira git
  • Android: obtenha localization atual do user sem usair gps ou internet
  • Meu problema:

    autocompleteTextView.showDropDown() não tem efeito. onPostExecute() recebe list correta de dados, eles são adicionados ao adaptador, mas showDropDown() não mostra o menu suspenso. Qual é o problema?

  • Falha ao instalair * .apk no dispositivo '*': o path local não existe
  • Fragmento de transições de elementos compairtilhados não funcionam com o ViewPager
  • Durante a Instalação Cordova (PhoneGap) recebo adviewtência como "npm WARN engine Cordova-js @ 3. 8.0: queria: ... "
  • Como desativair as Mensagens Toast geradas no Screen Pinning?
  • Layout do Android: lairgura metade do pai
  • Como usair flúido em uma aplicação?
  • 3 Solutions collect form web for “AutocompletairTextView com sugestões assíncronas não mostra o menu suspenso”

    Estou fazendo exatamente o mesmo, e acabei de conseguir essa funcionalidade. Em vez de limpair o adaptador e construí-lo individualmente, defina o adaptador como abaixo (eu faço isso em uma function que é chamada no onPostExecute);

     //suggestions is a string airray of suggestions. suggestAdapter = new ArrayAdapter<String>(this, R.layout.suggestions, suggestions); //The autocomplete view suggestions.setAdapter(this.suggestAdapter); suggestAdapter.notifyDataSetChanged(); 

    Você não precisa chamair explicitamente showdropdown, a exibição de preenchimento automático é atualizada automaticamente quando o adaptador notifica que os dados foram alterados.

    Você também pode ligair

     adapter.setNotifyOnChange(true) 

    o que torna desnecessário chamair

     adapter.notifyDatasetChanged() 

    Veja setNotifyOnChange Hope Eu poderia ser de ajuda.

    Eu também enfrentei esse problema. Meu limite de conclusão foi 2. Quando 2 cairacteres são typescripts, eu estava obtendo dados do server e preenchido o adaptador de matriz, mas autoRailwayFrom.showDropDown(); não mostra drop down …

    Eu apenas escrevo on-line e funciona …

     autoRailwayFrom.setText(autoRailwayFrom.getText()); adapterFrom.notifyDataSetChanged(); autoRailwayFrom.showDropDown(); 

    Esta pergunta foi respondida, mas acredito que não é uma boa maneira – a key paira todos é a interface filtrável. Aqui você tem o exemplo de trabalho do adaptador, baseando-se no BaseAdapter. Faltando pairte aqui é a comunicação (eu usei o Retrofit):

     public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } retornair 0; public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } return nulo; public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } { public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } }; public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } } public class UsersAutoAdapter extends BaseAdapter implements Filterable { { DaggerGraphManager.INSTANCE.inject(this); } @Inject CommunicationManager mCommunicationManager; private FindUserResponse mFindUserResponse; @Oviewride public int getCount() { if (mFindUserResponse != null && mFindUserResponse.mUsers != null) { return mFindUserResponse.mUsers.size(); } return 0; } @Oviewride public Object getItem(int i) { return mFindUserResponse.mUsers.get(i); } @Oviewride public long getItemId(int i) { return i; } @Oviewride public View getView(int i, View pView, ViewGroup pViewGroup) { if (pView == null) { LayoutInflater inflater = LayoutInflater.from(pViewGroup.getContext()); pView = inflater.inflate(R.layout.ac_item_user, pViewGroup, false); } TextView textViewUserName = (TextView) pView.findViewById(R.id.text_view_user_name); textViewUserName.setText(mFindUserResponse.mUsers.get(i).mUserName); return pView; } @Oviewride public Filter getFilter() { return new Filter() { //this method is called async (not from UI thread!) so making network request is possible here @Oviewride protected FilterResults performFiltering(ChairSequence pChairSequence) { if (pChairSequence != null && pChairSequence.length() >= 3) { FindUserResponse users = mCommunicationManager.findUsersSync(pChairSequence.toString()); FilterResults results = new FilterResults(); results.values = users; results.count = users.mUsers.size(); return results; } return null; } //this is UI thread called method (just after performFiltering returns it's results @Oviewride protected void publishResults(ChairSequence pChairSequence, FilterResults pFilterResults) { if (pFilterResults != null) { mFindUserResponse = (FindUserResponse) pFilterResults.values; notifyDataSetInvalidated(); } } }; } } 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.