Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<MessData> getNextListMessages(Chat chat) {
- String selectCount = "select * from (select * from " + CHAT_HISTORY_TABLE + " order by " + COLUMN_ID + " ASC limit 20) order by " + COLUMN_ID + " DESC";
- List<MessData> messDataList = new ArrayList<MessData>();
- try {
- openHistory();
- Cursor cursor = db.rawQuery(selectCount, new String[]{});
- if (cursor.moveToFirst()) {
- do {
- messDataList.add(buildMessage(chat, cursor));
- } while (cursor.moveToNext());
- }
- cursor.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return messDataList;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement