0

I am working on an Application where data is stored in Local Database and then shown in List view.if the data is less lets say 10 to 15 list items then it works fine but if its about 30 to 40 then scrolling is delayed some times.

How can i add Pagination from local database that is Load first 10 items and once user reaches bottom automatically loads next 10 and so on.

here is how i fetch data from database how can i use OFSET and LIMIT etc

where = POST_ID + "= '" + post.id + "' AND " + POST_TYPE + "= '" + post.postType + "'";
    cursor = db.query(getTableName(), null, where, null, null, null,
            null);
    log("getAlllist() cursor : " + cursor.getCount());
    if (cursor.getCount() > 0) {
        if (cursor.moveToFirst()) {
            menuArrayList = loadDataToList(cursor);
        }
    }

I am new to database so please help me

Android
  • 1,085
  • 4
  • 13
  • 28

0 Answers0