Advertisement
Guest User

Tastebin - Tkabber Plugin

a guest
Jun 8th, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public List<MessData> getNextListMessages(Chat chat) {
  2. String selectCount = "select * from (select * from " + CHAT_HISTORY_TABLE + " order by " + COLUMN_ID + " ASC limit 20) order by " + COLUMN_ID + " DESC";
  3. List<MessData> messDataList = new ArrayList<MessData>();
  4. try {
  5. openHistory();
  6. Cursor cursor = db.rawQuery(selectCount, new String[]{});
  7. if (cursor.moveToFirst()) {
  8. do {
  9. messDataList.add(buildMessage(chat, cursor));
  10. } while (cursor.moveToNext());
  11. }
  12. cursor.close();
  13. } catch (Exception e) {
  14. e.printStackTrace();
  15. }
  16. return messDataList;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement