Listing Inbox With Javamail Api
I'm getting inbox folder of my gmail account, can list the incoming e-mails, but that list is being listed from older mails to newer mails. How can i revert that ? public class
Solution 1:
either invert the order of the array , or for the getItem
, use the reverted index (count-position-1) .
btw, that's not an efficient way to use listviews , and in fact it has a memory leak which will cause it to crash after a lot of items (about 10000 is enough for SGS3) .
for more information about listView , check this video:
http://www.google.com/events/io/2010/sessions/world-of-listview-android.html
Solution 2:
You can get the total number of messages through inbox.getMessageCount()
, then retrieve last N number of messages.
Message messages[] = inbox.getMessages(inbox.getMessageCount() - 25 , inbox.getMessageCount());
Post a Comment for "Listing Inbox With Javamail Api"