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 3952890
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:54:32+00:00 2026-05-20T01:54:32+00:00

I want a filter for my ListView in Android. I have found this link

  • 0

I want a filter for my ListView in Android. I have found this link but I do that I cannot get the filter effect. Can somebody tell me what is wrong? my code is

 public class testListViewFilter extends ListActivity {
/** Called when the activity is first created. */
private EditText filterText = null;
ArrayAdapter<String> adapter = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

filterText = (EditText) findViewById(R.id.search_box);
filterText.addTextChangedListener(filterTextWatcher);

setListAdapter(new ArrayAdapter<String>(this,
               android.R.layout.simple_list_item_1, 
               mStrings));
adapter = new ArrayAdapter<String> (this,
        android.R.layout.simple_spinner_item,  mStrings);

}private TextWatcher filterTextWatcher = new TextWatcher() {



@Override
public void beforeTextChanged(CharSequence s, int start, int count,
        int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before,
        int count) {
    adapter.getFilter().filter(s);
}

@Override
public void afterTextChanged(Editable s) {
    // TODO Auto-generated method stub

}};
@Override
protected void onDestroy() {
super.onDestroy();
filterText.removeTextChangedListener(filterTextWatcher); }  
 private String[] mStrings = {
    "Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam", "Abondance", "Ackawi",
    "Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l Pitu", "Airag", "Airedale",
    "Aisy Cendre", "Allgauer Emmentaler", "Alverca", "Ambert", "American Cheese",
    "Ami du Chambertin", "Anejo Enchilado", "Anneau du Vic-Bilh", "Anthoriro", "Appenzell",
    "Aragon", "Ardi Gasna", "Ardrahan", "Armenian String", "Aromes au Gene de Marc",
    "Asadero", "Asiago", "Aubisque Pyrenees", "Autun", "Avaxtskyr", "Baby Swiss",
    "Babybel", "Baguette Laonnaise", "Bakers", "Baladi", "Balaton", "Bandal", "Banon",
    "Barry's Bay Cheddar", "Basing", "Basket Cheese", "Bath Cheese", "Bavarian Bergkase",
    "Baylough", "Beaufort", "Beauvoorde", "Beenleigh Blue", "Beer Cheese", "Bel Paese",
    "Bergader", "Bergere Bleue", "Berkswell", "Beyaz Peynir", "Bierkase", "Bishop Kennedy",
    "Blarney", "Bleu d'Auvergne", "Bleu de Gex", "Bleu de Laqueuille",
    "Bleu de Septmoncel", "Bleu Des Causses", "Blue", "Blue Castello", "Blue Rathgore",
    "Blue Vein (Australian)", "Blue Vein Cheeses", "Bocconcini", "Bocconcini (Australian)",
    "Boeren Leidenkaas", "Bonchester", "Bosworth", "Bougon", "Boule Du Roves",
    "Boulette d'Avesnes", "Boursault", "Boursin", "Bouyssou", "Bra", "Braudostur",
    "Breakfast Cheese", "Brebis du Lavort", "Brebis du Lochois", "Brebis du Puyfaucon",
    "Bresse Bleu", "Brick", "Brie", "Brie de Meaux", "Brie de Melun", "Brillat-Savarin",
    "Brin", "Brin d' Amour", "Brin d'Amour", "Brinza (Burduf Brinza)",
    "Briquette de Brebis", "Briquette du Forez", "Broccio", "Broccio Demi-Affine",
    "Brousse du Rove", "Bruder Basil", "Brusselae Kaas (Fromage de Bruxelles)", "Bryndza",
    "Buchette d'Anjou", "Buffalo", "Burgos", "Butte", "Butterkase", "Button (Innes)",
    "Buxton Blue", "Cabecou", "Caboc", "Cabrales", "Cachaille", "Caciocavallo", "Caciotta",
    "Caerphilly", "Cairnsmore", "Calenzana", "Cambazola", "Camembert de Normandie",
    "Canadian Cheddar", "Canestrato", "Cantal", "Caprice des Dieux", "Capricorn Goat",
    "Capriole Banon", "Carre de l'Est", "Casciotta di Urbino", "Cashel Blue", "Castellano",
    "Castelleno", "Castelmagno", "Castelo Branco", "Castigliano", "Cathelain",
    "Celtic Promise", "Cendre d'Olivet", "Cerney", "Chabichou", "Chabichou du Poitou",
    "Chabis de Gatine", "Chaource", "Charolais", "Chaumes", "Cheddar",
    "Cheddar Clothbound", "Cheshire", "Chevres", "Chevrotin des Aravis", "Chontaleno",
    "Civray", "Coeur de Camembert au Calvados", "Coeur de Chevre", "Colby", "Cold Pack",
    "Comte", "Coolea", "Cooleney", "Coquetdale", "Corleggy", "Cornish Pepper",
    "Cotherstone", "Cotija", "Cottage Cheese", "Cottage Cheese (Australian)",
    "Cougar Gold", "Coulommiers", "Coverdale", "Crayeux de Roncq", "Cream Cheese",
    "Cream Havarti", "Crema Agria", "Crema Mexicana", "Creme Fraiche", "Crescenza",
    "Croghan", "Crottin de Chavignol", "Crottin du Chavignol", "Crowdie", "Crowley",
    "Cuajada", "Curd", "Cure Nantais", "Curworthy", "Cwmtawe Pecorino",
    "Cypress Grove Chevre", "Danablu (Danish Blue)", "Danbo", "Danish Fontina",
    "Daralagjazsky", "Dauphin", "Delice des Fiouves", "Denhany Dorset Drum", "Derby",
    "Dessertnyj Belyj", "Devon Blue", "Devon Garland", "Dolcelatte", "Doolin",
    "Doppelrhamstufel", "Dorset Blue Vinney", "Double Gloucester", "Double Worcester",
    "Dreux a la Feuille", "Dry Jack", "Duddleswell", "Dunbarra", "Dunlop", "Dunsyre Blue",
    "Duroblando", "Durrus", "Dutch Mimolette (Commissiekaas)", "Edam", "Edelpilz",
    "Emental Grand Cru", "Emlett", "Emmental", "Epoisses de Bourgogne", "Esbareich",
    "Esrom", "Etorki", "Evansdale Farmhouse Brie", "Evora De L'Alentejo", "Exmoor Blue",
    "Explorateur", "Feta", "Feta (Australian)", "Figue", "Filetta", "Fin-de-Siecle",
    "Finlandia Swiss", "Finn", "Fiore Sardo", "Fleur du Maquis", "Flor de Guia",
    "Flower Marie", "Folded", "Folded cheese with mint", "Fondant de Brebis",
    "Fontainebleau", "Fontal", "Fontina Val d'Aosta", "Formaggio di capra", "Fougerus",
    "Four Herb Gouda", "Fourme d' Ambert", "Fourme de Haute Loire", "Fourme de Montbrison",
    "Fresh Jack", "Fresh Mozzarella", "Fresh Ricotta", "Fresh Truffles", "Fribourgeois",
    "Friesekaas", "Friesian", "Friesla", "Frinault", "Fromage a Raclette", "Fromage Corse",
    "Fromage de Montagne de Savoie", "Fromage Frais", "Fruit Cream Cheese",
    "Frying Cheese", "Fynbo", "Gabriel", "Galette du Paludier", "Galette Lyonnaise",
    "Galloway Goat's Milk Gems", "Gammelost", "Gaperon a l'Ail", "Garrotxa", "Gastanberra",
    "Geitost", "Gippsland Blue", "Gjetost", "Gloucester", "Golden Cross", "Gorgonzola",
    "Gornyaltajski", "Gospel Green", "Gouda", "Goutu", "Gowrie", "Grabetto", "Graddost",
    "Grafton Village Cheddar", "Grana", "Grana Padano", "Grand Vatel",
    "Grataron d' Areches", "Gratte-Paille", "Graviera", "Greuilh", "Greve",
    "Gris de Lille", "Gruyere", "Gubbeen", "Guerbigny", "Halloumi",
    "Halloumy (Australian)", "Haloumi-Style Cheese", "Harbourne Blue", "Havarti",
    "Heidi Gruyere", "Hereford Hop", "Herrgardsost", "Herriot Farmhouse", "Herve",
    "Hipi Iti", "Hubbardston Blue Cow", "Hushallsost", "Iberico", "Idaho Goatster",
    "Idiazabal", "Il Boschetto al Tartufo", "Ile d'Yeu", "Isle of Mull", "Jarlsberg",
    "Jermi Tortes", "Jibneh Arabieh", "Jindi Brie", "Jubilee Blue", "Juustoleipa",
    "Kadchgall", "Kaseri", "Kashta", "Kefalotyri", "Kenafa", "Kernhem", "Kervella Affine",
    "Kikorangi", "King Island Cape Wickham Brie", "King River Gold", "Klosterkaese",
    "Knockalara", "Kugelkase", "L'Aveyronnais", "L'Ecir de l'Aubrac", "La Taupiniere",
    "La Vache Qui Rit", "Laguiole", "Lairobell", "Lajta", "Lanark Blue", "Lancashire",
    "Langres", "Lappi", "Laruns", "Lavistown", "Le Brin", "Le Fium Orbo", "Le Lacandou",
    "Le Roule", "Leafield", "Lebbene", "Leerdammer", "Leicester", "Leyden", "Limburger",
    "Lincolnshire Poacher", "Lingot Saint Bousquet d'Orb", "Liptauer", "Little Rydings",
    "Livarot", "Llanboidy", "Llanglofan Farmhouse", "Loch Arthur Farmhouse",
    "Loddiswell Avondale", "Longhorn", "Lou Palou", "Lou Pevre", "Lyonnais", "Maasdam",
    "Macconais", "Mahoe Aged Gouda", "Mahon", "Malvern", "Mamirolle", "Manchego",
    "Manouri", "Manur", "Marble Cheddar", "Marbled Cheeses", "Maredsous", "Margotin",
    "Maribo", "Maroilles", "Mascares", "Mascarpone", "Mascarpone (Australian)",
    "Mascarpone Torta", "Matocq", "Maytag Blue", "Meira", "Menallack Farmhouse",
    "Menonita", "Meredith Blue", "Mesost", "Metton (Cancoillotte)", "Meyer Vintage Gouda",
    "Mihalic Peynir", "Milleens", "Mimolette", "Mine-Gabhar", "Mini Baby Bells", "Mixte",
    "Molbo", "Monastery Cheeses", "Mondseer", "Mont D'or Lyonnais", "Montasio",
    "Monterey Jack", "Monterey Jack Dry", "Morbier", "Morbier Cru de Montagne",
    "Mothais a la Feuille", "Mozzarella", "Mozzarella (Australian)",
    "Mozzarella di Bufala", "Mozzarella Fresh, in water", "Mozzarella Rolls", "Munster",
    "Murol", "Mycella", "Myzithra", "Naboulsi", "Nantais", "Neufchatel",
    "Neufchatel (Australian)", "Niolo", "Nokkelost", "Northumberland", "Oaxaca",
    "Olde York", "Olivet au Foin", "Olivet Bleu", "Olivet Cendre",
    "Orkney Extra Mature Cheddar", "Orla", "Oschtjepka", "Ossau Fermier", "Ossau-Iraty",
    "Oszczypek", "Oxford Blue", "P'tit Berrichon", "Palet de Babligny", "Paneer", "Panela",
    "Pannerone", "Pant ys Gawn", "Parmesan (Parmigiano)", "Parmigiano Reggiano",
    "Pas de l'Escalette", "Passendale", "Pasteurized Processed", "Pate de Fromage",
    "Patefine Fort", "Pave d'Affinois", "Pave d'Auge", "Pave de Chirac", "Pave du Berry",
    "Pecorino", "Pecorino in Walnut Leaves", "Pecorino Romano", "Peekskill Pyramid",
    "Pelardon des Cevennes", "Pelardon des Corbieres", "Penamellera", "Penbryn",
    "Pencarreg", "Perail de Brebis", "Petit Morin", "Petit Pardou", "Petit-Suisse",
    "Picodon de Chevre", "Picos de Europa", "Piora", "Pithtviers au Foin",
    "Plateau de Herve", "Plymouth Cheese", "Podhalanski", "Poivre d'Ane", "Polkolbin",
    "Pont l'Eveque", "Port Nicholson", "Port-Salut", "Postel", "Pouligny-Saint-Pierre",
    "Pourly", "Prastost", "Pressato", "Prince-Jean", "Processed Cheddar", "Provolone",
    "Provolone (Australian)", "Pyengana Cheddar", "Pyramide", "Quark",
    "Quark (Australian)", "Quartirolo Lombardo", "Quatre-Vents", "Quercy Petit",
    "Queso Blanco", "Queso Blanco con Frutas --Pina y Mango", "Queso de Murcia",
    "Queso del Montsec", "Queso del Tietar", "Queso Fresco", "Queso Fresco (Adobera)",
    "Queso Iberico", "Queso Jalapeno", "Queso Majorero", "Queso Media Luna",
    "Queso Para Frier", "Queso Quesadilla", "Rabacal", "Raclette", "Ragusano", "Raschera",
    "Reblochon", "Red Leicester", "Regal de la Dombes", "Reggianito", "Remedou",
    "Requeson", "Richelieu", "Ricotta", "Ricotta (Australian)", "Ricotta Salata", "Ridder",
    "Rigotte", "Rocamadour", "Rollot", "Romano", "Romans Part Dieu", "Roncal", "Roquefort",
    "Roule", "Rouleau De Beaulieu", "Royalp Tilsit", "Rubens", "Rustinu", "Saaland Pfarr",
    "Saanenkaese", "Saga", "Sage Derby", "Sainte Maure", "Saint-Marcellin",
    "Saint-Nectaire", "Saint-Paulin", "Salers", "Samso", "San Simon", "Sancerre",
    "Sap Sago", "Sardo", "Sardo Egyptian", "Sbrinz", "Scamorza", "Schabzieger", "Schloss",
    "Selles sur Cher", "Selva", "Serat", "Seriously Strong Cheddar", "Serra da Estrela",
    "Sharpam", "Shelburne Cheddar", "Shropshire Blue", "Siraz", "Sirene", "Smoked Gouda",
    "Somerset Brie", "Sonoma Jack", "Sottocenare al Tartufo", "Soumaintrain",
    "Sourire Lozerien", "Spenwood", "Sraffordshire Organic", "St. Agur Blue Cheese",
    "Stilton", "Stinking Bishop", "String", "Sussex Slipcote", "Sveciaost", "Swaledale",
    "Sweet Style Swiss", "Swiss", "Syrian (Armenian String)", "Tala", "Taleggio", "Tamie",
    "Tasmania Highland Chevre Log", "Taupiniere", "Teifi", "Telemea", "Testouri",
    "Tete de Moine", "Tetilla", "Texas Goat Cheese", "Tibet", "Tillamook Cheddar",
    "Tilsit", "Timboon Brie", "Toma", "Tomme Brulee", "Tomme d'Abondance",
    "Tomme de Chevre", "Tomme de Romans", "Tomme de Savoie", "Tomme des Chouans", "Tommes",
    "Torta del Casar", "Toscanello", "Touree de L'Aubier", "Tourmalet",
    "Trappe (Veritable)", "Trois Cornes De Vendee", "Tronchon", "Trou du Cru", "Truffe",
    "Tupi", "Turunmaa", "Tymsboro", "Tyn Grug", "Tyning", "Ubriaco", "Ulloa",
    "Vacherin-Fribourgeois", "Valencay", "Vasterbottenost", "Venaco", "Vendomois",
    "Vieux Corse", "Vignotte", "Vulscombe", "Waimata Farmhouse Blue",
    "Washed Rind Cheese (Australian)", "Waterloo", "Weichkaese", "Wellington",
    "Wensleydale", "White Stilton", "Whitestone Farmhouse", "Wigmore", "Woodside Cabecou",
    "Xanadu", "Xynotyro", "Yarg Cornish", "Yarra Valley Pyramid", "Yorkshire Blue",
    "Zamorano", "Zanetti Grana Padano", "Zanetti Parmigiano Reggiano"};
} 
  • 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-05-20T01:54:32+00:00Added an answer on May 20, 2026 at 1:54 am

    The problem is that the adapter variable is not the same ArrayAdapter that you use in SetListAdapter().

    Try using this code in the OnCreate() method:

    this.adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mStrings);
    setListAdapter(adapter);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that I want to use to filter a listview. I
I have an string like this:- $sa_position = state/Gold,International/Participant,School/Participant,School/Bronze,national/Bronze,School/Gold; And I want filter this
I have a MultipleChoiceField on a form holding car makes. I want to filter
I have a paged ASP.NET ListView. The data shown is filtered, which can be
i have a alphabetic filter consist of 26 dynamically created link button on selecting
on my website I have a comment section. I want to filter and validate
I have a List of words I want to ignore like this one :
I want to use a temp directory that will be unique to this build.
If all tables I want to delete from have the column gamer_id can i
I've tried to filter my ListView from my EditText box, but currently, it's not

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.