Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Android - Using Custom Views to Read Database Data - Slows Down Drastically!

 
Joe Masilotti
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing my first Android application and need some help with Custom Views.

Right now I have a database that lists two columns and about 300 entries or so (which will continue to grow). In my code I have a class that uses a LayoutInflator to help re-use an .xml layout. Then, it creates an instance of this class for each data entry, and displays it.

I have run a few tests and have come to the conclusion that the large delay is when I am creating the instance of the objects, not querying or displaying them.

Is there a better way to do this? My app is working well, but the delay every time you open it is really a pain.


Also, my rows appear all at once. I noticed on many other apps that once one loads, it will display that, then the next, etc. How is this done?

Thank you in advance for any help you can give me!
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using a ListView, by any chance? If so, check out this topic, particularly Monu's 3rd post and my 3rd post.
 
Joe Masilotti
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Are you using a ListView, by any chance? If so, check out this topic, particularly Monu's 3rd post and my 3rd post.


Well this is embarrassing... I had never even heard of ListViews before! I was pretty much trying to re-create it from scratch. Thank you so much for your post!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic