Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Create and update adapter that can set list of user
- */
- private void setListUser(){
- if(getListAdapter()==null){
- // init adapter
- adapter=new UserArrayAdapter(getActivity(),
- friends);
- setListAdapter(adapter);
- }
- else
- {
- //update adapter
- adapter.notifyDataSetChanged();
- }
- }
- public boolean onQueryTextSubmit(String newText) {
- ListUser lt = (ListUser)
- getSupportFragmentManager().findFragmentById(R.id.listuser_fragment);
- if (lt != null) {
- lt.refreshList(newText);
- }
- public void refreshList(String toSearch){
- friends= SearchUser(toSearch, this.getActivity().getApplication());
- setListUser();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement