Search any text from arraylist










2















I am working on search i have one string that i have added in arraylist and in that string if i have search word it displays values of related word like in my arrylist there is one record like "you are a developer" if i searched you are it displays correct result but if i searched are you developer it can not display results so how to solve it



this is my adapter class.



import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sonal.mindwerx.Item.SearchModel;
import com.sonal.mindwerx.R;
import com.sonal.mindwerx.SearchDisplay;

import java.util.ArrayList;
import java.util.List;


public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.MyViewHolder> implements Filterable {
ArrayList<SearchModel> filterList;
private List<SearchModel> searchlist;
private Context context;


public class MyViewHolder extends RecyclerView.ViewHolder


public TextView tv_name_search, tv_code_search;
public LinearLayout ll_search_item;

public MyViewHolder(View view)
super(view);

tv_name_search = (TextView) view.findViewById(R.id.tv_name_search);
tv_code_search = (TextView) view.findViewById(R.id.tv_code_search);
ll_search_item = (LinearLayout) view.findViewById(R.id.ll_search_item);





public SearchAdapter(Context context, ArrayList<SearchModel> searchlist)
this.context = context;
this.searchlist = searchlist;
this.filterList = searchlist;


@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.search_item, parent, false);
return new MyViewHolder(itemView);


@Override
public void onBindViewHolder(final MyViewHolder holder, int position)
final SearchModel searchModel = searchlist.get(position);
holder.tv_name_search.setText(searchModel.getName());
holder.tv_code_search.setText(searchModel.getCode());

holder.ll_search_item.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(context, SearchDisplay.class);
intent.putExtra("sonalcode", searchModel.getCode());
String rate = searchModel.getRate();
intent.putExtra("rate", searchModel.getRate());
intent.putExtra("productid", searchModel.getProductid());
intent.putExtra("brandid", searchModel.getBrandid());
context.startActivity(intent);

);



CustomFilter filter;


@Override
public int getItemCount()
return searchlist.size();


@Override
public Filter getFilter()
if (filter == null)
filter = new CustomFilter();

return filter;




class CustomFilter extends Filter
@Override
protected FilterResults performFiltering(CharSequence constraint)
// TODO Auto-generated method stub
FilterResults results = new FilterResults();
if (constraint != null && constraint.length() > 0)
//CONSTARINT TO UPPER
constraint = constraint.toString().toLowerCase();

ArrayList<SearchModel> filters = new ArrayList<SearchModel>();
String separated = constraint.toString().toLowerCase().split(" ");

//get specific items
for (int i = 0; i < filterList.size(); i++)
for (int j = 0; j < separated.length; j++)

results.count = filters.size();
results.values = filters;
else
results.count = filterList.size();
results.values = filterList;

return results;


@Override
protected void publishResults(CharSequence constraint, FilterResults results)
// TODO Auto-generated method stub
searchlist = (ArrayList<SearchModel>) results.values;
notifyDataSetChanged();




This is my searchview



searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() 

@Override
public boolean onQueryTextSubmit(String query)

rv_search.setVisibility(View.GONE);
return false;


@Override
public boolean onQueryTextChange(String newText)
/*newText = newText.replace(" ", "");
newText = newText.trim();*/
if (newText != null && TextUtils.getTrimmedLength(newText) > 0)

rv_search.setVisibility(View.VISIBLE);
searchAdapter.getFilter().filter(newText);

else
rv_search.setVisibility(View.GONE);



return false;

);









share|improve this question
























  • You may need to split the keywords and check the string one by one.

    – Chanjung Kim
    Nov 13 '18 at 11:26











  • is there any solution

    – Mind Werx
    Nov 14 '18 at 10:19











  • split the keywords and use && for making sure all the keywords together.

    – Chanjung Kim
    Nov 14 '18 at 11:00











  • i have splitted but it not giving same result

    – Mind Werx
    Nov 15 '18 at 6:32











  • i have edited my code please check

    – Mind Werx
    Nov 15 '18 at 6:33















2















I am working on search i have one string that i have added in arraylist and in that string if i have search word it displays values of related word like in my arrylist there is one record like "you are a developer" if i searched you are it displays correct result but if i searched are you developer it can not display results so how to solve it



this is my adapter class.



import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sonal.mindwerx.Item.SearchModel;
import com.sonal.mindwerx.R;
import com.sonal.mindwerx.SearchDisplay;

import java.util.ArrayList;
import java.util.List;


public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.MyViewHolder> implements Filterable {
ArrayList<SearchModel> filterList;
private List<SearchModel> searchlist;
private Context context;


public class MyViewHolder extends RecyclerView.ViewHolder


public TextView tv_name_search, tv_code_search;
public LinearLayout ll_search_item;

public MyViewHolder(View view)
super(view);

tv_name_search = (TextView) view.findViewById(R.id.tv_name_search);
tv_code_search = (TextView) view.findViewById(R.id.tv_code_search);
ll_search_item = (LinearLayout) view.findViewById(R.id.ll_search_item);





public SearchAdapter(Context context, ArrayList<SearchModel> searchlist)
this.context = context;
this.searchlist = searchlist;
this.filterList = searchlist;


@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.search_item, parent, false);
return new MyViewHolder(itemView);


@Override
public void onBindViewHolder(final MyViewHolder holder, int position)
final SearchModel searchModel = searchlist.get(position);
holder.tv_name_search.setText(searchModel.getName());
holder.tv_code_search.setText(searchModel.getCode());

holder.ll_search_item.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(context, SearchDisplay.class);
intent.putExtra("sonalcode", searchModel.getCode());
String rate = searchModel.getRate();
intent.putExtra("rate", searchModel.getRate());
intent.putExtra("productid", searchModel.getProductid());
intent.putExtra("brandid", searchModel.getBrandid());
context.startActivity(intent);

);



CustomFilter filter;


@Override
public int getItemCount()
return searchlist.size();


@Override
public Filter getFilter()
if (filter == null)
filter = new CustomFilter();

return filter;




class CustomFilter extends Filter
@Override
protected FilterResults performFiltering(CharSequence constraint)
// TODO Auto-generated method stub
FilterResults results = new FilterResults();
if (constraint != null && constraint.length() > 0)
//CONSTARINT TO UPPER
constraint = constraint.toString().toLowerCase();

ArrayList<SearchModel> filters = new ArrayList<SearchModel>();
String separated = constraint.toString().toLowerCase().split(" ");

//get specific items
for (int i = 0; i < filterList.size(); i++)
for (int j = 0; j < separated.length; j++)

results.count = filters.size();
results.values = filters;
else
results.count = filterList.size();
results.values = filterList;

return results;


@Override
protected void publishResults(CharSequence constraint, FilterResults results)
// TODO Auto-generated method stub
searchlist = (ArrayList<SearchModel>) results.values;
notifyDataSetChanged();




This is my searchview



searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() 

@Override
public boolean onQueryTextSubmit(String query)

rv_search.setVisibility(View.GONE);
return false;


@Override
public boolean onQueryTextChange(String newText)
/*newText = newText.replace(" ", "");
newText = newText.trim();*/
if (newText != null && TextUtils.getTrimmedLength(newText) > 0)

rv_search.setVisibility(View.VISIBLE);
searchAdapter.getFilter().filter(newText);

else
rv_search.setVisibility(View.GONE);



return false;

);









share|improve this question
























  • You may need to split the keywords and check the string one by one.

    – Chanjung Kim
    Nov 13 '18 at 11:26











  • is there any solution

    – Mind Werx
    Nov 14 '18 at 10:19











  • split the keywords and use && for making sure all the keywords together.

    – Chanjung Kim
    Nov 14 '18 at 11:00











  • i have splitted but it not giving same result

    – Mind Werx
    Nov 15 '18 at 6:32











  • i have edited my code please check

    – Mind Werx
    Nov 15 '18 at 6:33













2












2








2








I am working on search i have one string that i have added in arraylist and in that string if i have search word it displays values of related word like in my arrylist there is one record like "you are a developer" if i searched you are it displays correct result but if i searched are you developer it can not display results so how to solve it



this is my adapter class.



import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sonal.mindwerx.Item.SearchModel;
import com.sonal.mindwerx.R;
import com.sonal.mindwerx.SearchDisplay;

import java.util.ArrayList;
import java.util.List;


public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.MyViewHolder> implements Filterable {
ArrayList<SearchModel> filterList;
private List<SearchModel> searchlist;
private Context context;


public class MyViewHolder extends RecyclerView.ViewHolder


public TextView tv_name_search, tv_code_search;
public LinearLayout ll_search_item;

public MyViewHolder(View view)
super(view);

tv_name_search = (TextView) view.findViewById(R.id.tv_name_search);
tv_code_search = (TextView) view.findViewById(R.id.tv_code_search);
ll_search_item = (LinearLayout) view.findViewById(R.id.ll_search_item);





public SearchAdapter(Context context, ArrayList<SearchModel> searchlist)
this.context = context;
this.searchlist = searchlist;
this.filterList = searchlist;


@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.search_item, parent, false);
return new MyViewHolder(itemView);


@Override
public void onBindViewHolder(final MyViewHolder holder, int position)
final SearchModel searchModel = searchlist.get(position);
holder.tv_name_search.setText(searchModel.getName());
holder.tv_code_search.setText(searchModel.getCode());

holder.ll_search_item.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(context, SearchDisplay.class);
intent.putExtra("sonalcode", searchModel.getCode());
String rate = searchModel.getRate();
intent.putExtra("rate", searchModel.getRate());
intent.putExtra("productid", searchModel.getProductid());
intent.putExtra("brandid", searchModel.getBrandid());
context.startActivity(intent);

);



CustomFilter filter;


@Override
public int getItemCount()
return searchlist.size();


@Override
public Filter getFilter()
if (filter == null)
filter = new CustomFilter();

return filter;




class CustomFilter extends Filter
@Override
protected FilterResults performFiltering(CharSequence constraint)
// TODO Auto-generated method stub
FilterResults results = new FilterResults();
if (constraint != null && constraint.length() > 0)
//CONSTARINT TO UPPER
constraint = constraint.toString().toLowerCase();

ArrayList<SearchModel> filters = new ArrayList<SearchModel>();
String separated = constraint.toString().toLowerCase().split(" ");

//get specific items
for (int i = 0; i < filterList.size(); i++)
for (int j = 0; j < separated.length; j++)

results.count = filters.size();
results.values = filters;
else
results.count = filterList.size();
results.values = filterList;

return results;


@Override
protected void publishResults(CharSequence constraint, FilterResults results)
// TODO Auto-generated method stub
searchlist = (ArrayList<SearchModel>) results.values;
notifyDataSetChanged();




This is my searchview



searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() 

@Override
public boolean onQueryTextSubmit(String query)

rv_search.setVisibility(View.GONE);
return false;


@Override
public boolean onQueryTextChange(String newText)
/*newText = newText.replace(" ", "");
newText = newText.trim();*/
if (newText != null && TextUtils.getTrimmedLength(newText) > 0)

rv_search.setVisibility(View.VISIBLE);
searchAdapter.getFilter().filter(newText);

else
rv_search.setVisibility(View.GONE);



return false;

);









share|improve this question
















I am working on search i have one string that i have added in arraylist and in that string if i have search word it displays values of related word like in my arrylist there is one record like "you are a developer" if i searched you are it displays correct result but if i searched are you developer it can not display results so how to solve it



this is my adapter class.



import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sonal.mindwerx.Item.SearchModel;
import com.sonal.mindwerx.R;
import com.sonal.mindwerx.SearchDisplay;

import java.util.ArrayList;
import java.util.List;


public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.MyViewHolder> implements Filterable {
ArrayList<SearchModel> filterList;
private List<SearchModel> searchlist;
private Context context;


public class MyViewHolder extends RecyclerView.ViewHolder


public TextView tv_name_search, tv_code_search;
public LinearLayout ll_search_item;

public MyViewHolder(View view)
super(view);

tv_name_search = (TextView) view.findViewById(R.id.tv_name_search);
tv_code_search = (TextView) view.findViewById(R.id.tv_code_search);
ll_search_item = (LinearLayout) view.findViewById(R.id.ll_search_item);





public SearchAdapter(Context context, ArrayList<SearchModel> searchlist)
this.context = context;
this.searchlist = searchlist;
this.filterList = searchlist;


@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.search_item, parent, false);
return new MyViewHolder(itemView);


@Override
public void onBindViewHolder(final MyViewHolder holder, int position)
final SearchModel searchModel = searchlist.get(position);
holder.tv_name_search.setText(searchModel.getName());
holder.tv_code_search.setText(searchModel.getCode());

holder.ll_search_item.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(context, SearchDisplay.class);
intent.putExtra("sonalcode", searchModel.getCode());
String rate = searchModel.getRate();
intent.putExtra("rate", searchModel.getRate());
intent.putExtra("productid", searchModel.getProductid());
intent.putExtra("brandid", searchModel.getBrandid());
context.startActivity(intent);

);



CustomFilter filter;


@Override
public int getItemCount()
return searchlist.size();


@Override
public Filter getFilter()
if (filter == null)
filter = new CustomFilter();

return filter;




class CustomFilter extends Filter
@Override
protected FilterResults performFiltering(CharSequence constraint)
// TODO Auto-generated method stub
FilterResults results = new FilterResults();
if (constraint != null && constraint.length() > 0)
//CONSTARINT TO UPPER
constraint = constraint.toString().toLowerCase();

ArrayList<SearchModel> filters = new ArrayList<SearchModel>();
String separated = constraint.toString().toLowerCase().split(" ");

//get specific items
for (int i = 0; i < filterList.size(); i++)
for (int j = 0; j < separated.length; j++)

results.count = filters.size();
results.values = filters;
else
results.count = filterList.size();
results.values = filterList;

return results;


@Override
protected void publishResults(CharSequence constraint, FilterResults results)
// TODO Auto-generated method stub
searchlist = (ArrayList<SearchModel>) results.values;
notifyDataSetChanged();




This is my searchview



searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() 

@Override
public boolean onQueryTextSubmit(String query)

rv_search.setVisibility(View.GONE);
return false;


@Override
public boolean onQueryTextChange(String newText)
/*newText = newText.replace(" ", "");
newText = newText.trim();*/
if (newText != null && TextUtils.getTrimmedLength(newText) > 0)

rv_search.setVisibility(View.VISIBLE);
searchAdapter.getFilter().filter(newText);

else
rv_search.setVisibility(View.GONE);



return false;

);






android search arraylist full-text-search adapter






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 6:31







Mind Werx

















asked Nov 13 '18 at 11:02









Mind WerxMind Werx

145




145












  • You may need to split the keywords and check the string one by one.

    – Chanjung Kim
    Nov 13 '18 at 11:26











  • is there any solution

    – Mind Werx
    Nov 14 '18 at 10:19











  • split the keywords and use && for making sure all the keywords together.

    – Chanjung Kim
    Nov 14 '18 at 11:00











  • i have splitted but it not giving same result

    – Mind Werx
    Nov 15 '18 at 6:32











  • i have edited my code please check

    – Mind Werx
    Nov 15 '18 at 6:33

















  • You may need to split the keywords and check the string one by one.

    – Chanjung Kim
    Nov 13 '18 at 11:26











  • is there any solution

    – Mind Werx
    Nov 14 '18 at 10:19











  • split the keywords and use && for making sure all the keywords together.

    – Chanjung Kim
    Nov 14 '18 at 11:00











  • i have splitted but it not giving same result

    – Mind Werx
    Nov 15 '18 at 6:32











  • i have edited my code please check

    – Mind Werx
    Nov 15 '18 at 6:33
















You may need to split the keywords and check the string one by one.

– Chanjung Kim
Nov 13 '18 at 11:26





You may need to split the keywords and check the string one by one.

– Chanjung Kim
Nov 13 '18 at 11:26













is there any solution

– Mind Werx
Nov 14 '18 at 10:19





is there any solution

– Mind Werx
Nov 14 '18 at 10:19













split the keywords and use && for making sure all the keywords together.

– Chanjung Kim
Nov 14 '18 at 11:00





split the keywords and use && for making sure all the keywords together.

– Chanjung Kim
Nov 14 '18 at 11:00













i have splitted but it not giving same result

– Mind Werx
Nov 15 '18 at 6:32





i have splitted but it not giving same result

– Mind Werx
Nov 15 '18 at 6:32













i have edited my code please check

– Mind Werx
Nov 15 '18 at 6:33





i have edited my code please check

– Mind Werx
Nov 15 '18 at 6:33












1 Answer
1






active

oldest

votes


















1














 public Filter getFilter() 

return new Filter()
@Override
protected FilterResults performFiltering(CharSequence constraint)
FilterResults results = new FilterResults();
List<DatumVoters> filteredResults = null;
if (constraint.length() == 0)
filteredResults = odatumList;
else
filteredResults =
getFilteredResults(constraint.toString().toLowerCase());



results.values = filteredResults;

return results;


@Override
protected void publishResults(CharSequence charSequence, FilterResults
results)
ddatumList = (List<DatumVoters>) results.values;
adapter.notifyDataSetChanged();

;


protected List<DatumVoters> getFilteredResults(String s)
List<DatumVoters> results = new ArrayList<>();
for (DatumVoters item : odatumList)
if (item.getFirstname().toLowerCase().contains(s)
return results;






share|improve this answer























  • not working sir

    – Mind Werx
    Nov 13 '18 at 11:49










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53279585%2fsearch-any-text-from-arraylist%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














 public Filter getFilter() 

return new Filter()
@Override
protected FilterResults performFiltering(CharSequence constraint)
FilterResults results = new FilterResults();
List<DatumVoters> filteredResults = null;
if (constraint.length() == 0)
filteredResults = odatumList;
else
filteredResults =
getFilteredResults(constraint.toString().toLowerCase());



results.values = filteredResults;

return results;


@Override
protected void publishResults(CharSequence charSequence, FilterResults
results)
ddatumList = (List<DatumVoters>) results.values;
adapter.notifyDataSetChanged();

;


protected List<DatumVoters> getFilteredResults(String s)
List<DatumVoters> results = new ArrayList<>();
for (DatumVoters item : odatumList)
if (item.getFirstname().toLowerCase().contains(s)
return results;






share|improve this answer























  • not working sir

    – Mind Werx
    Nov 13 '18 at 11:49















1














 public Filter getFilter() 

return new Filter()
@Override
protected FilterResults performFiltering(CharSequence constraint)
FilterResults results = new FilterResults();
List<DatumVoters> filteredResults = null;
if (constraint.length() == 0)
filteredResults = odatumList;
else
filteredResults =
getFilteredResults(constraint.toString().toLowerCase());



results.values = filteredResults;

return results;


@Override
protected void publishResults(CharSequence charSequence, FilterResults
results)
ddatumList = (List<DatumVoters>) results.values;
adapter.notifyDataSetChanged();

;


protected List<DatumVoters> getFilteredResults(String s)
List<DatumVoters> results = new ArrayList<>();
for (DatumVoters item : odatumList)
if (item.getFirstname().toLowerCase().contains(s)
return results;






share|improve this answer























  • not working sir

    – Mind Werx
    Nov 13 '18 at 11:49













1












1








1







 public Filter getFilter() 

return new Filter()
@Override
protected FilterResults performFiltering(CharSequence constraint)
FilterResults results = new FilterResults();
List<DatumVoters> filteredResults = null;
if (constraint.length() == 0)
filteredResults = odatumList;
else
filteredResults =
getFilteredResults(constraint.toString().toLowerCase());



results.values = filteredResults;

return results;


@Override
protected void publishResults(CharSequence charSequence, FilterResults
results)
ddatumList = (List<DatumVoters>) results.values;
adapter.notifyDataSetChanged();

;


protected List<DatumVoters> getFilteredResults(String s)
List<DatumVoters> results = new ArrayList<>();
for (DatumVoters item : odatumList)
if (item.getFirstname().toLowerCase().contains(s)
return results;






share|improve this answer













 public Filter getFilter() 

return new Filter()
@Override
protected FilterResults performFiltering(CharSequence constraint)
FilterResults results = new FilterResults();
List<DatumVoters> filteredResults = null;
if (constraint.length() == 0)
filteredResults = odatumList;
else
filteredResults =
getFilteredResults(constraint.toString().toLowerCase());



results.values = filteredResults;

return results;


@Override
protected void publishResults(CharSequence charSequence, FilterResults
results)
ddatumList = (List<DatumVoters>) results.values;
adapter.notifyDataSetChanged();

;


protected List<DatumVoters> getFilteredResults(String s)
List<DatumVoters> results = new ArrayList<>();
for (DatumVoters item : odatumList)
if (item.getFirstname().toLowerCase().contains(s)
return results;







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 13 '18 at 11:31









suresh madaparthisuresh madaparthi

25219




25219












  • not working sir

    – Mind Werx
    Nov 13 '18 at 11:49

















  • not working sir

    – Mind Werx
    Nov 13 '18 at 11:49
















not working sir

– Mind Werx
Nov 13 '18 at 11:49





not working sir

– Mind Werx
Nov 13 '18 at 11:49



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53279585%2fsearch-any-text-from-arraylist%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo