Pubblicato il 7 aprile 2013 da frabbe
ListView: aggiungere un filtro personalizzato

Nell’applicazione che sto sviluppando attualmente avevo necessità di implementare una funzionalità abbastanza particolare: i risultati di una query visualizzati all’interno di una ListView come stringhe di testo dovevano poter essere filtrati “in tempo reale” mediante l’inserimento di un testo da parte dell’utente in una apposita casella… sviluppare da zero una simile funzionalità avrebbe richiesto un sacco di tempo, mi sono quindi chiesto se Google non ci avesse già pensato prima di me, implementando magari qualcosa di utile tra le classi dell’SDK e la risposta è SI!
Si tratta di lavorare sulla classe dell’Adapter che nel nostro caso estenderà una delle classi base fornite da Android per collegarsi ad un database o ad un array; tutte queste classi possono infatti estendere una particolare interfaccia denominata Filterable
che fa proprio al caso nostro, permettendoci di gestire l’operazione di filtro dei dati mostrati nella lista mediante l’implementazione del metodo getFilter()
dell’interfaccia e di una estensione privata della classe Filter
.
A questo punto è sufficiente raccogliere la stringa di input dell’utente nel modo preferito (io ho inserito una casella di testo come footer della ListView, come spiegato in un altro articolo) e passare la stringa all’adapter della ListView mediante il comando
myAdapter.getFilter().filter(stringaFiltro.toString()); |
Davvero semplicissimo!
Trovate tutti i dettagli ed un chiarissimo tutorial per implementare il vostro filtro in questo articolo del blog Surviving w/ Android, blog che tra le altre cose vi consiglio di seguire perchè davvero interessante!
Fonti:
Android ListView: Custom filter and filterable interface
24 Commenti
Lascia un commento a questo articolo!
Lascia un commento
Visita il mio sito web
10 ottobre 2013
Permalink
wordpress themes ha detto:
I got this website from my buddy who told me concerning this web site and at the moment this time I am browsing this site and reading very informative content at this time.
Visita il mio sito web
17 dicembre 2013
Permalink
business school rankings ha detto:
Hello there, i believe that i saw an individual seen my site therefore i found give back the need? . Now i’m trying to to locate items to enhance my website! Perhaps their alright to apply certain of this basics!
Visita il mio sito web
18 giugno 2014
Permalink
Johnd710 ha detto:
Excellent blog right here! Also your site lots up very fast! What web host are you the use of? Can I get your affiliate hyperlink for your host? I desire my website loaded up as quickly as yours lol ceggdegfcddb
Visita il mio sito web
8 agosto 2014
Permalink
ebuynow.com ha detto:
Facebook profiles usually contain very private data.
As you explore this social networking site, you can share your interests with other people.
When you click the “Like” button, people viewing that image, link or post will see your name underneath the “Likes” heading.
facebook likes buy targeted, ebuynow.com,
Visita il mio sito web
4 novembre 2014
Permalink
samsung chromebook case girls ha detto:
This article will help the internet users for setting up new webpage or even a weblog from
start to end.
Visita il mio sito web
19 novembre 2014
Permalink
Windows app developer ha detto:
How did you choose the theme for the site?
I truly like how it looks, and would also like to get hold of the theme forr my personal blog.
Visita il mio sito web
23 maggio 2023
Permalink
disqus.Com ha detto:
Eat Local and Eⲭрerience Locaⅼ must be
evеrybody’ѕ firѕt 2 steps foг ɑ complete immersion holiday.
Visita il mio sito web
4 febbraio 2024
Permalink
find here ha detto:
Please let me know if you’re looking for a writer for your site.
You have some really great articles and I believe I would be
a good asset. If you ever want to take some of the load off, I’d
really like to write some content for your blog in exchange for
a link back to mine. Please send me an email if interested.
Cheers!
Visita il mio sito web
22 ottobre 2024
Permalink
the pokies.net 62 ha detto:
While Christmas definitely didn’t start out this manner, by most measures it has grow to be one of the crucial commercialized holidays round, heavily merchandised by a taskforce of nostalgic characters and indicators. Besides to amazing theme and graphics, one of many options we see on this recreation is the auto spin one. And the symbols themselves keep true to the theme as properly with candles, milk and cookies, bells, stockings, and even a gingerbread home. As well as, every of those games featuring Batman and considered one of his nemesis incorporates plenty of familiar enjoyable including classic animation from the 1960s television show, the theme music we can all easily summon up, re-spins, free spins, enormous symbols, stacked symbols, and mega symbols in addition. No want to enroll or pay to play the pokie video games. African Dream on-line pokie has incredible life-like graphics which nearly do justice to the pure beauties of Africa itself. Easter Eggs online pokie looks precisely as we’d expect, it’s colourful, cheerful, it’s highly detailed and comes in beautiful graphics.
Visita il mio sito web
23 ottobre 2024
Permalink
theexpeditionfilm.com ha detto:
Well few video video games are ok to establish themselves as a household identify. THE 2005 Smart Travel Asia Favourite Airline Poll closed end July (after a gradual three-month online vote) with some predictable results, a number of yawns, and some attention-grabbing surprises. Within the Philippines, the place individuals are at all times looking out for convenient ways to have fun and possibly earn, digital bingo platforms have discovered their viewers. Filipino players not solely interact in the sport but also share ideas, tricks, and suggestions on varied platforms. Bingo Blog.With its actual-time chat characteristic, players can work together, forming bonds over shared video games. The reserve is the final place on the island the place a forest remained intact after colonists first arrived in 1609. But rising sea ranges – brought on by whirlpools of heat water called gyres – could also be causing the loss over a time period of up to 70% of the cedar trees. By researching your choices, exploring financing alternatives, taking a radical check drive, and finalizing your buy with their helpful gross sales group, you’ll be driving off in your dream car very quickly.
Visita il mio sito web
25 ottobre 2024
Permalink
Dario Dawkins ha detto:
Well few video games are adequate to establish themselves as a household title. THE 2005 Smart Travel Asia Favourite Airline Poll closed end July (after a gradual three-month online vote) with some predictable results, just a few yawns, and some attention-grabbing surprises. In the Philippines, where individuals are all the time looking out for convenient ways to have enjoyable and probably earn, digital bingo platforms have found their viewers. Filipino players not only have interaction in the game but also share ideas, tips, and feedback on numerous platforms. Bingo Blog.With its actual-time chat function, gamers can interact, forming bonds over shared video games. The reserve is the last place on the island where a forest remained intact after colonists first arrived in 1609. But rising sea ranges – brought on by whirlpools of heat water called gyres – could also be inflicting the loss over a period of time of as much as 70% of the cedar timber. By researching your options, exploring financing opportunities, taking an intensive check drive, and finalizing your purchase with their useful sales staff, you’ll be driving off in your dream car in no time.
Visita il mio sito web
25 ottobre 2024
Permalink
Gracie Molineux ha detto:
We’ve run Smallchat, a default-free saas app, for a number of years now, supporting thousands and thousands of customers. We’ve had success with that mannequin earlier than. Trucks, regardless of which make and model you’re using, have grow to be a typical need of any business to switch items, products or equipment from one location to another in safe and convenient method on time. Have you ever learn Sahil Lavingia’s weblog? Is any content material in this weblog significantly related to Easyful’s motive for existence or are you just mentioning it because you loved the publish? Do you have a weblog or some stats to have a look at? Does stripe ship emails and you just have the emails contain the content as attachments or straight textual content? I’m fairly sure they do with Stripe Checkout? Stripe does not act as Merchant of Record. All Easyful users are using Stripe Payment links. Our experience: with low-operating-price saas apps like this, you can add a paid tier with professional features if you get a whole lot of traction while protecting the bottom app free.With Smallchat, for instance, a small proportion of paid customers greater than covers the operating prices of our mostly-free person base.
Visita il mio sito web
25 ottobre 2024
Permalink
Dave Stanton ha detto:
This colder weather can result in more wear and tear on crucial systems and appliances, resulting in more frequent points. For homeowners with expensive techniques and appliances, the extra protection supplied by the upper coverage caps could make the barely pricier rates worthwhile in the long term. Plus, its commonplace waiting interval before a new policy kicks in is just 30 days, which is significantly better than different providers that make homeowners wait 60 days or more. While my old AMD CPU has 8 cores and it does pack a punch, it was made within the olden days. While this is rarely the case with huge shops comparable to Amazon or Walmart, if you pick a less-recognized store, hackers might be able to get entry to your on-line banking account or credit card information. The credit card or debit card it is best to hook up with the account must be Philippine-primarily based. If you select to apply (and are accredited) for a new bank card by means of our site, we may receive compensation from our companions, and this will likely affect how or where these merchandise appear. Some country’s bilingual texts are so few there’s not much to tug from – so when you input nonsense into the machine, the machine offers you back its best guess at what you’re statistically attempting to say.
Visita il mio sito web
25 ottobre 2024
Permalink
Patty Tyner ha detto:
Before finalizing your buy, it’s crucial to take the automobile for a test drive. We are seeing as much as round 15 or 20 cheats that players have somehow been able to test and confirm. The Sweet Bonanza slot is a perfect match for players of all talent levels, and it’s playable on your laptop or cell device. To make your go to to Suricrasia, you have to enter the next coordinates into the shipboard pc. What we are able to say from early rumors is that they’re button codes and can’t be saved in the telephone like in GTA 4. So each time you need to use one, you will need to do it manually. Good luck if you want to get GTA information that’s spoiler free proper now. Spoiler alert, but you possibly can test our growing assortment of GTA 5 suggestions and methods. Try our World’s Largest GTA 5 Tips and Tricks Collection right here and also discover all the opposite glitches, guides and cool secrets and techniques. To cash out your incomes here in Nigeria isn’t an issue. You’ll Start Earning Within MINUTES.
Visita il mio sito web
25 ottobre 2024
Permalink
Kenny Driskell ha detto:
Drivers’ licenses have to be renewed every two years. Recently Uber introduced a partnership with the IndyCar circuit to permit officials to grant momentary driver’s licenses to people who are approved by the state’s Department of Motor Vehicles to drive the automobiles. Other deadweight losses include the effects of Christmas on the setting and the truth that material gifts are sometimes perceived as white elephants, imposing value for upkeep and storage and contributing to litter. Buy Nothing Christmas first turned official in 2001 when a small group of Canadian Mennonites created an internet site and gave the motion a reputation. There were a complete of 1,416,459 OONI measurements of net connectivity recorded in Hong Kong throughout the primary half of 2022. This got here from the testing of 2228 domains through 30 native ASNs and 18 foreign ASNs. However, there have been no replies from each events after three weeks. There are a large number of credit organizations within the country offering to borrow money on-line. I know that their hardware specs are loads better but certainly not 5x higher. Indianapolis’ transportation financial system has been thriving for more than a century, however there is an opportunity to make transportation in the town even higher.
Visita il mio sito web
25 ottobre 2024
Permalink
Sergio Pannell ha detto:
This simplified approach makes choosing the right safety easier in comparison with opponents with confusing plan options. Use our under calculator tool to estimate the yearly cost of a brand new residence warranty plan to your Iowa home. Choice Home Warranty affords the next elective add-ons to Iowa homeowners. After submitting a claim, homeowners can simply monitor its status online, making the experience much less anxious. As a Midwest homeowner, I give American Home Shield a solid 8.4/10 rating for its buyer expertise. I give Choice Home Warranty a solid 8.4/10 ranking for its customer expertise. MTrading ensures safety and top-notch service, validated by trade awards and customer satisfaction. Choice Home Warranty excels in its excessive claims approval percentage, surpassing competitors in the home warranty trade. Maintaining perfect consistency throughout a wide community of 25,000 technicians could be difficult, and Choice receives mostly constructive suggestions on the claims process with a excessive proportion of accepted claims. However, a lot of the unfavorable suggestions appears to stem from misunderstandings over complex policy details, emphasizing the importance of thoroughly analyzing contract phrases before you sign up.
Visita il mio sito web
25 ottobre 2024
Permalink
Shelli Casiano ha detto:
See how our consumer-friendly site lets you expertise bike procuring anyplace and anytime. You’ll be able to get pleasure from incredible reductions, clearance gross sales and different unique promotions when buying with us. It had recently (when i opened this) been proven that customers can upload HTML recordsdata as property and have them served as pages, with full client-sides scripting privileges. Capitol constructing and phrases that join the dots amongst customers inside on-line conversations. As ecosystem owners, we want to raised moderate and have extra discussions with the group about what we anticipate of our customers almost about both social behavior and code contributions. Tara Institute® at all times works hard and makes you motivated and charged about your goal via common teaching classes for CLAT and motivational seminars and group discussions which make your thoughts alert and keep you on observe and make them the very best institute for CLAT. The agenda of the AGM is printed before the assembly, with all of the scheduled discussions and decisions spelled out.
Visita il mio sito web
25 ottobre 2024
Permalink
Antonetta Hurd ha detto:
Uber rates in Indianapolis appear reasonable. Uber charges in Indianapolis could seem a little greater than in other cities, but Uber has an open door policy and permits any driver that seems like they’ve been handled unfairly by a ride-hailing company to take their service elsewhere. Uber says that it has had “dozens” of complaints in regards to the Indianapolis Police Department and we have seen no signs of any modifications after this season. In January 2021, a neighborhood ISP “Hong Kong Broadband Network”, responded to media inquiries, affirming their execution of censorship was responding to the request from the Hong Kong Police Force on the grounds of National Security. On June 30, 2020, the Standing Committee of the National People’s Congress unanimously determined to enact and implement the Hong Kong National Security Law. On June 30, 2020, the Standing Committee of the National People’s Congress unanimously decided1011 to enact and implement the Hong Kong National Security Law, a countermeasure to the mass protest on the street and establishing the legislative energy for local authorities to censorships primarily based on national security grounds. For security and budgeting, some decide to use a pay as you go card whereas on trip. Chief Executive candidates are vetted and only approved by the Committee for Safeguarding National Security and not using a simple interesting mechanism9.
Visita il mio sito web
25 ottobre 2024
Permalink
Noel Dorman ha detto:
It also seemingly entails no less than one crew bar, the place many ship employees like to put the “work hard, play arduous” philosophy to the check. However, bear in thoughts that cruise ship workers don’t pay something for food and lodging, and lots of crew members (waitstaff and housekeeping) can supplement their wages with suggestions. The code has a role of improving requirements of business conduct in the meals and grocery sector. So that is from an organization perspective, a thanks to every of them that I’ll do the help position. Online casinos with on the spot payout have sturdy, responsive buyer support that promptly attends to every inquiry. Besides responding early, buyer assist has a robust knowledge of the processes and is all the time ready to supply options. That is one cause why crew members are largely employees from creating nations – wages that could seem low to Americans are more acceptable to them.
Visita il mio sito web
25 ottobre 2024
Permalink
Wallace Winifred ha detto:
So you might want to group subscribers. These are designed to re-interact lost subscribers. We’ve networks, experience, and an understanding of the media business – all of which are required that can assist you raise consciousness for your organization. While AHS’s service fees, ranging from $one hundred to $125, exceed the $75 industry common, the company provides flexibility via lower monthly premiums or larger service fees, permitting you to decide on your preferred possibility. And at the same time as a newer provider, Liberty earns optimistic suggestions for its responsive claims service. It’s a unique method to spend an afternoon and perhaps even ignite a lifelong passion for vehicles. It’s about building a subscriber checklist and list administration. Proper e-mail record administration means getting rid of typos. Building your listing organically by means of decide-ins and content material marketing ensures the next engagement rate and maintains the integrity of your email advertising and marketing efforts.11. This segmentation enhances engagement rates by ensuring that the content material is relevant to every subscriber group. These are labels to make an email marketing campaign more targeted.These are used to ship fixed contact affords to different subscriber inboxes.
Visita il mio sito web
25 ottobre 2024
Permalink
Tommy Kroger ha detto:
I take advantage of these questions to evaluate the affordability of each attraction. Just use that! Srsly, WAT! With a customized media list, you will have a better probability of getting press protection and media attention from journalists and bloggers in your area of interest. In this case, we might advise you to search for journalists who are specifically targeted on gaming. Simply seek for “India Tv Live” on these platforms and subscribe/comply with their official pages for common updates. From creating relevant journalist e mail lists to distributing search engine optimized press releases, Pressfarm has all the things it’s good to get your PR campaign finished. After creating your account, you can start looking via a wide range of products available at Woolworths. In conclusion, exploring lucrative alternatives in Australia opens doorways to a variety of industries and sectors. With an increasing demand for slicing-edge expertise options throughout industries resembling finance, healthcare, and e-commerce, software program builders are in excessive demand. This creates a demand for solar panel installers and technicians who will help people and companies transition to clean vitality sources. With the rise of on-line shopping, there’s a growing demand for revolutionary e-commerce platforms that provide seamless person experiences.
Visita il mio sito web
25 ottobre 2024
Permalink
Wilbert Reade ha detto:
For this function, Google uses works which have been translated into as many languages as doable, like UN Documents and the Bible. When you have any questions or concerns about your order, you may reach their buyer help group by way of telephone or e mail. In conclusion, navigating the automotive shopping for course of at Aubrey Alexander Selinsgrove PA is a seamless expertise due to their vast number of autos and commitment to exceptional customer service. In this text, we are going to information you through every step of the automobile buying journey at Aubrey Alexander Selinsgrove PA, making certain that you simply drive away with the perfect vehicle to your wants. Soon, Forex Penguin will probably be making a profitability scale (Penguin Meter) that compares the issue levels for making use of no deposit bonuses throughout a variety of brokers. In conclusion, exploring profitable opportunities in Australia opens doors to a variety of industries and sectors. Online buying is booming in the Philippines as extra Filipinos flock to e-commerce for a variety of products and services. With easy account creation, various delivery options, particular features like customized shopping lists, and excellent buyer support, it’s no surprise why extra Australians are turning to on-line grocery buying. Special mention to RiversideRocks for raising awareness about shell security in a CTF challenge that includes command injection shortly before this.
Visita il mio sito web
25 ottobre 2024
Permalink
Raphael Freytag ha detto:
It offers multi-asset trading, straightforward copy buying and selling of high traders, and ultra-low spreads. FXOpen, established in 2005, empowers traders with a trader-centric method, offering low-value trading with spreads from 0.0 pips and commissions from $1.50 per lot. Offering low spreads and zero commissions, they intention to streamline buying and selling. Known for its sturdy Partnership program with up to 60% revenue share, it boasts tight spreads from zero pips, 1:A thousand leverage, and in depth instructional resources. Our platform options a consumer-friendly interface, low spreads starting from 0.2 pips, zero fee fees, swap-free trading, low $10 minimum deposits, high leverage as much as 1:3000, and quick trade execution through prime-tier knowledge centers worldwide. Offering a diverse vary of belongings, low charges, and innovative features like Autocopy. Use Pressfarm to reach out to retailers like Business Insider, Forbes, Mashable and plenty of more. Not all of them are as genuine as we might like them to be. Whether you’re an Indian living abroad or just desirous about Indian tradition and information, this text will provide you with every little thing it’s essential to learn about watching India Tv Live.
Visita il mio sito web
25 ottobre 2024
Permalink
Ambrose Bellinger ha detto:
For this purpose, Google uses works that have been translated into as many languages as attainable, like UN Documents and the Bible. You probably have any questions or concerns about your order, you possibly can reach their customer support group by way of phone or e-mail. In conclusion, navigating the automotive buying process at Aubrey Alexander Selinsgrove PA is a seamless expertise thanks to their wide selection of autos and dedication to distinctive customer service. In this article, we will guide you thru each step of the automotive buying journey at Aubrey Alexander Selinsgrove PA, making certain that you simply drive away with the perfect car for your needs. Soon, Forex Penguin shall be making a profitability scale (Penguin Meter) that compares the difficulty levels for making use of no deposit bonuses throughout a spread of brokers. In conclusion, exploring lucrative opportunities in Australia opens doors to a wide range of industries and sectors. Online purchasing is booming in the Philippines as more Filipinos flock to e-commerce for a wide range of services and products. With straightforward account creation, varied delivery options, particular features like customized buying lists, and wonderful buyer assist, it’s no wonder why extra Australians are turning to online grocery purchasing. Special mention to RiversideRocks for elevating consciousness about shell security in a CTF challenge featuring command injection shortly earlier than this.