I am using following code to get data from SQlite, I got perfect data very quickly in cursor.
When I am iterating the cursor, it takes >10 seconds to fetch 31 records from cursor.
My Query takes time 0.016150 second(s) to execute.
How can i reduce this time to <1 second ?
Cursor cursor = dbHelper.getFollowedValuesForCalendar();
if(cursor!=null && cursor.getCount()>0)
{
cursor.moveToFirst();
int followedDateIndex = cursor.getColumnIndex(Info.FOLLOWED_DATE);
int followedCountIndex = cursor.getColumnIndex(Info.FOLLOWED_COUNT);
int successValueIndex = cursor.getColumnIndex(Info.SUCCESS_VALUE);
int isEnableIndex = cursor.getColumnIndex(Info.IS_ENABLE);
do
{
Info.previousFollowedDaysList.add(cursor.getString(followedDateIndex));
Info.previousFollowedValuesList.add(cursor.getInt(followedCountIndex));
Info.successValuesList.add(cursor.getInt(successValueIndex));
Info.isEnableList.add(cursor.getInt(isEnableIndex));
}while(cursor.moveToNext());
}
else
{
//System.out.println(" Records between dates ==============>>>> 0");
}
if(cursor!=null)
cursor.close();