Load progressive ListView

by arnouf » Mon, 17 Aug 2009 15:40:14 GMT

Sponsored Links
 Hi all,

I've a ListActivity. Data are provided by a Thread calling a URL to
load data from a database. The URL returns data from position x to x
+5 . the x value is sent by my application indicating the position of
the last displayed item.

Now I would like to know, how can I detect when user is on the last
record displayed in my ListView. This can give information to recall
my URL with the new x.

I tried to implement it in my ArrayAdapter.getView() method, testing
the getPosition() and myArray length...It works well but everytime!

This should work like GMail app for example (you have 50 last
discussions loaded by default and if you go down after these 50, a new
loading is done).

What is the good solution?

Big thanks by advance for your help.



Load progressive ListView

by Mark Murphy » Mon, 17 Aug 2009 19:55:57 GMT


I do not know if it is "good", but this is what I wrote to handle this


One of these days, I will cobble together enough time to add more
documentation and a blog post about this...

Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_Android Programming Tutorials_ Version 1.0 In Print!


Sponsored Links

Other Threads

1. How to go back from 2.2 to 2.1update (ERE27) on nexus one

The OP said:

I would qualify manually updating your firmware with some zip file off the
internet as unofficial.

Right ... OTA updates ... not zip files posted to the internet...

Who told you it was?

You're assuming what was in that zip file is what's going out OTA. From what
I read, what was out there for people to manually install was the buggy
pre-release - one would presume that what they release OTA will be the
official, verified 2.2.

TreKing - Chicago transit tracking app for Android-powered devices


2. VideoMemo: long file path cannot work


I have an issue about the video playback.

If the file path is long, e.g
the video cannot be palyed.

While,if the path is shorter, e.g
It is played well.

This issue is confirmed on Platform 2.0 simulator and Magic H/W.

Would you please provide some idea about this problem?
Thanks a lot.



3. What the difference between code 'setContentView.(R.layout.main_layout);' and 'setContentView(R.layout.main_layout);'

4. Can I use the return matrix of getrotationmatrix() to translate the accelerate to world coordinate system

5. HTC desire couldn't connect to bluetooth device.

6. TelephonyManager.listen() additive? API docs unclear.

7. Videoplayer source code