Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9172721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:25:05+00:00 2026-06-17T16:25:05+00:00

private ArrayList <HashMap<String, Object>> availableFriends; public ListAdapter adapter = null; friendsearch = (EditText)findViewById(R.id.friendsearch); friendsearch.addTextChangedListener(new

  • 0
private ArrayList <HashMap<String, Object>> availableFriends;
public ListAdapter adapter = null;
friendsearch = (EditText)findViewById(R.id.friendsearch);
        friendsearch.addTextChangedListener(new TextWatcher() {

            public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
                // When user changed the Text
                FriendsActivity.this.adapter.getFilter().filter(cs);

In the above line i am getting the error ,here what i am trying to do is search in a custom list view (list view with image and name)
}

        public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
                int arg3) {
            // TODO Auto-generated method stub

        }

        public void afterTextChanged(Editable arg0) {
            // TODO Auto-generated method stub
        }
    });

below code shows you how i am getting the list data and how i am displaying the list data.
if it required please watch it other wise leave it.

public List<Friend> getFriendsList(){
    String accessToken = null;
    DatabaseHelper helper = new DatabaseHelper(getApplicationContext());
    DatabaseUtility dao = new DatabaseUtility(helper);
    try {
        accessToken = dao.getAccessToken();
    } catch (Exception e1) {
        handler.sendEmptyMessage(1);
        return null;
    }
    if(accessToken == null || accessToken.length() == 0){
        handler.sendEmptyMessage(1);
        return null;
    }

    Map<String , String> params = new HashMap<String,String>();
    params.put(Constants.ACCESS_TOKEN_PARAM, accessToken);

    List<Friend> friendsList = null;
    try {
            friendsList = Utils.getFriendsList(params,this);
    } catch (NullPointerException e) {
        handler.sendEmptyMessage(12);
        return null;
    } catch (JSONException e) {
        //handler.sendEmptyMessage(11);
        return null;
    }
    return friendsList;
}

public void displayFriends(List<Friend> friendList){
    List<Friend> friendsList = friendList;
    availableFriends = new ArrayList<HashMap<String,Object>>();
    HashMap<String, Object> friendData = null;
    Friend friend = null;
    try{
        for(int i = 0 ; i < friendsList.size() ; i++){
            friend = friendsList.get(i);
            friendData = new HashMap<String, Object>();
            friendData.put(FRIENDS_NAME_KEY, friend.getFriendName());
            friendData.put(IS_IMAGE_KEY, friend.getIsImage());
            friendData.put(IDKEY, friend.getFriendID());
            availableFriends.add(friendData);
        }

    adapter = new ListAdapter(availableFriends,FriendsActivity.this);
    listView.setAdapter(adapter);
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:25:07+00:00Added an answer on June 17, 2026 at 4:25 pm

    ListAdapter does not implement the Filterable interface. However, some adapters, such as ArrayAdapter and SimpleAdapter do. This means you should consider switching your adapter to something that implements the interface or make your own custom Adapter and implement it there.

    Also, based on the code above, you set your adapter to be null and you don’t initialize it (I don’t see a call to displayFriends(). You should also look into that to make sure your initializations are proper (after choosing a more appropriate adapter of course).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class PackageTabActivity extends ListActivity{ HashMap<String,Object> hm ; ArrayList<HashMap<String,Object>> applistwithicon ; private static final
base adapter code public class ListAdapter extends BaseAdapter{ public ArrayList<HashMap<String,String>> list; Activity activity; public
`Adapter class ::: public class YAdapter extends ArrayAdapter<String> { ArrayList<String> items; Context context; private
private static final String picpic = picpic; private ArrayList < HashMap < String, Object>>
Consider this code: package Prova; import java.util.ArrayList; public class Prova { private ArrayList<String> people;
private List<String> subList; private List<List<String>> records = new ArrayList<List<String>>(); for(....){ subList = new ArrayList<String>();
Considering this part of a Java class, private List<Object> components = new ArrayList<Object>(); private
I have a Hashmap object allList in the form with type HashMap<String,ArrayList<Item>> . I
OK, so here is my ArrayList : private List<ClientThread> clients = new ArrayList<ClientThread>(); and
I have an array list of objects in my application. private static ArrayList<Player> userList=new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.