How to make ListView super fast

This might be the most asked question. How a listview can be made faster/smoother is really all about optimizations of the code.



You should probably always use a Holder class not to findViewById in every getView call. According to a google IO thingy, this would slightly increase the performance of your ListView.

Of course, do not forget to use the logic: if(convertView == null) then (convertView = new InflatedView). Then intialise everything in convertView... bla bla bla.

However, today I got a +1 on one of my answers on stackoverflow. I gave away a small hack.
@Override
public long getItemViewType(int position) {
     return position;
}
@Override
public long getViewTypeCount(int position) {
     return getCount();
}
@Override
public View getView(int position, View convertView, ViewGroup arg2) {
    if (convertView == null) {
        //inflate your convertView and set everything
    }
    //do not do anything just return the convertView
    return convertView;
}

I found out that I had a small typo: I fixed that. Anyway, I would like to give this away and it would really be nice to tell me if this does not work with you.
The hack is simple: I give each view its own view type, and, therefore, I force the ListView to do the whole caching on its own.

46 comments:

  1. this is shushCrappy code. :p

    ReplyDelete
    Replies
    1. I think I know who is this shushpicious body that commented.

      Delete
  2. The best way to protect your expensive smartphone is by using a case.
    It not only protects your phone from damage due to accidental drop, but also imparts beauty to your phone.
    Here are some of the best and exclusive cases for you.
    You can check them out and select one for your phone Galaxy S8 TPU Cases

    ReplyDelete
  3. Best Android phones are as good as the other Smartphones on the market. oukitelcentral

    ReplyDelete
  4. At the point when the engineers make custom UI interfaces in their own particular manner, the applications don't look or capacity reliably crosswise over various gadgets. from this source

    ReplyDelete
  5. I simply could not depart your web site prior to suggesting that I extremely enjoyed the standard info a person provide on your guests? Is going to be again often in order to check out new posts

    androsupport.com


    ReplyDelete
  6. Exceptionally helpful post. This is my first time i visit here. I discovered such a variety of fascinating stuff in your web journal particularly its exchange. Truly its extraordinary article. Keep it up. App Valley

    ReplyDelete
  7. Features Of Gamecih Download Steps To Install GameCIH APK.

    ReplyDelete
  8. Thank you for posting such a great article! I found your website perfect for my needs
    Read More

    ReplyDelete
  9. Read the information you share, it is very helpful for me. Hope I will learn more interesting information on your blog.
    Dịch vụ: vận chuyển ô tô giá rẻ, dịch vụ bốc xếp, dịch vụ ship cod, vận chuyển xe máy bắc nam, cho thuê xe tải, vận chuyển container,... Đang được proship cung cấp tới quý khách hàng với chất lượng uy tín, giá cả canh tranh nhất thị trường hiện nay.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. Attend The Data Analytics Course From ExcelR. Practical Data Analytics Course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analytics Course.
    ExcelR Data Analytics Course

    ReplyDelete
  12. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
    ExcelR data analytics courses

    ReplyDelete

  13. Best Article buy Pain Pills online Excellent post. I appreciate this site. Stick with it! Because the admin of this web page is working, no doubt very quickly it will be well-known, due to its quality contents.This website was how do you say it? Relevant!! Finally, I’ve found something that helped me.
    Best Article buy Roxicodone online Excellent post
    buy Xanax online
    buy Oxycodone online

    Best Article buy Pain Medications online Excellent post. I appreciate this site. Stick with it! Because the admin of this web page is working, no doubt very quickly it will be well-known, due to its quality contents.This website was how do you say it? Relevant!! Finally, I’ve found something that helped me.

    buy Research Chemicals online

    buy Roxicodone online

    buy Cbd Isolate online

    ReplyDelete
  14. Great job in giving the right content the reasonable clarification. The substance looks genuine with substantial data. Great Work

    ReplyDelete
  15. I just wanted to inform you that the process of reviewing is quite difficult and can be described by every professional.

    ReplyDelete
  16. It really doe work on my smartphone, many thanks to you. It really fastens my listview, be sure to continue and do more on this theme.

    ReplyDelete
  17. GBInsta is the Android application which will help the users to download Instagram images, videos, and stories in just some clicks without external app.Click here to download

    ReplyDelete
  18. Marijuana—also called weed, herb, pot, grass, bud, ganja, Mary Jane, and a vast number of other slang terms—is a greenish-gray mixture of the dried flowers of Cannabis sativa.

    The main active chemical in marijuana is THC (delta-9-tetrahydrocannabinol), the psychoactive ingredient. The highest concentrations of THC are found in the dried flowers, or buds. When marijuana smoke is inhaled, THC rapidly passes from the lungs into the bloodstream and is carried to the brain and other organs throughout the body. THC from the marijuana acts on specific receptors in the brain, called cannabinoid receptors, starting off a chain of cellular reactions that finally lead to the euphoria, or "high" that users experience. Feeling of a relaxed state, euphoria, and an enhanced sensory perception may occur. With higher THC levels in those who are not used to the effects, some people may feel anxious, paranoid, or have a panic attack.
    Cannabis plant used for medical or recreational purposes. The main psychoactive part of cannabis is tetrahydrocannabinol, one of the 483 known compounds in the plant, including at least 65 other cannabinoids. 
    buy real weed online
    how to buy weed online
    buy legal weed online
    buy recreational weed online
    buy weed edibles online
    can i buy weed online
    buy medical weed online
    buy weed online canada
    buying weed online reviews
    buy weed online legit
    buy weed online without medical card
    buy weed seeds online canada
    order marijuana online
    order marijuana seeds online
    how to order marijuana online
    order marijuana online without a medical card
    can you order medical marijuana online
    order marijuana online

    ReplyDelete
  19. that's the great one. thanks for sharing this post with us.
    Trainz simulator Apk is one of the most amazing applications designed for players who love to play racing games. The simulator lets the user learn the method by which he can make his railway with full control. The game is amazingly designed with full controls feature. You can easily control the train tracks, railways, roads, designing of the plate-form and everything that you need to customize.
    visit and check

    ReplyDelete
  20. It really dose work on my smartphone, many thanks to you. It really fastens my list view, be sure to continue and do more on this theme on Whatsapp.

    ReplyDelete
  21. Best Article about weed for sale. Excellent post. I appreciate this site. thanks for sharing! Because the admin of this web page is working, no doubt very quickly it will be well-known, due to its quality contents. I’ve found something that helped me. it has never been easy to buy weed online in USA because there are few suppliers who can actually supply you with good quality weed.



    BUY WEED ONLINE.

    BUY  RUNTZ ONLINE

    BUY GUSHER ONLINE

    WEED FOR SELL ONLINE

    BUY SHARKLATO ONLINE

    BUY MOON ROCKS ONLINE

    BUY BERNERS COOKIES ONLINE

    BUY MAMBAZ ONLINE

    WEED FOR SELL.

    MARIJUANA FOR SELL

    BUY MARIJUANA

    DABSTAR OIL FOR SALE










    ReplyDelete
  22. Your site has a lot of useful information for myself. I visit regularly. Hope to have more quality items. Also I would like to share some information also. Check out GBWhatsapp APK Download

    ReplyDelete
  23. Bravo excellent work i really like it thanks for sharing. GBWhatsApp Apk latest version

    ReplyDelete
  24. SSC Exam Result is a trending now in Bangladesh. SSC Examination was completed. All students are waiting to get their SSC Exam Result 2020. This year SSC Result 2020 will publish on 1st week in May. On the result day, after 12PM all students will get their SSC Exam Result 2020 from Bangladesh Education Board official website. Also Dakhil Result 2020 and SSC Vocational Result 2020 will publish on 6 May 2020

    ReplyDelete
  25. SSC Exam Result 2020 in Bangladesh. SSC Result coming soon. All students are waiting to get their SSC Result 2020. This year SSC Result 2020 will publish on 06 May 2020. Students can collect their SSC Result 2020 from Bangladesh Education Board official website.

    ReplyDelete
  26. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. keep it up.
    data analytics course in Bangalore

    ReplyDelete
  27. I'm happy to see the considerable subtle element here!.download latest version of gbwhatsapp

    ReplyDelete
  28. Are you looking best way to download Instagram images and video in your device. Just try Gbinsta It is best app to download instagram photos. Click here to download.

    ReplyDelete
  29. movies123 Specifically, are the tools, core modules, APIs competitive. Is the scope of the work similar or more extensive. What is the early evaluation of applications and device developers?

    ReplyDelete
  30. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression
    data science interview questions

    ReplyDelete
  31. Its as if you had a great grasp on the subject matter, but you forgot to include your readers. Perhaps you should think about this from more than one angle.

    take the rice purity test




    ReplyDelete
  32. Your work is very good and I appreciate you and hopping for some more informative posts

    plugin manager notepad++

    ReplyDelete
  33. Very nice post i really appreciate to for this work I hope you will keep continuous to publish tis type of posts...Kinemaster Gold mod apk

    ReplyDelete