I have this messaging project I created.
Like facebook messenger or hangouts the new data are loaded at the bottom and older data are at the top.
my app loads the top 20 latest conversation. my problem is if the user scrolls up the older data should be loaded
I have something like this
List<Conversation> conve = new ArrayList<Conversation>();
ArrayAdapter<Conversation> adapter;
declared as global in my activity
I load the top 20 latest conversation in my conve then set the adapter on create
when a new message arrive.
I have the new message into the array
this.conve.add(..);
then execute notifyDateSetChange(); for adapter to update the data. everything was fine.
for now I am stuck right now. How do I update the first elements of the adapter if the users scrolles up? how do I update my adapter to have the old conversation? any ideas about this or sample. Thanks