Quickblox: how can I show the last 25 messages? Android -
i wondering how can show recent 25 messages in chat. on chat @ top there button show older 25 , on...
first need order retrieved data according date in descending order, create apaging
manage display of messages. regardless loading messages data local database of online web services, need arrange retrieval of data segmenting data pages
.
you define the page size (equal 25 in case), , define page number. example, rows page 1, first row: (page-1)*size = (1-1)*25 = 0, last row: (first row + size - 1).
if have button load next 25 rows, need increment pages 1, so when have page = 2 , index of row 1 = (2-1)*25=25, last row index = 25+25-1=49.
Comments
Post a Comment