public View getView(int position, View convertView, ViewGroup parent) {
...
boolean flag = db.isRegistered(contactId_text);
ImageView iv = (ImageView) vi.findViewById(R.id.typeImage);
if (flag) {
holder.image1.setImageResource(R.drawable.registered);
}
...
}
The above is my code block in the getView(). The db.isRegistered(contactId_text) method is a query that takes some time to get a result, so it lags my listview scrolling screen, what’s a good way to handle this? I tried AsyncTask, but when the list gets too long, u get the AsyncTask limit error(Forgot the exception name).
Ok solved! I used MatrixCursor to form my own custom cursor then set this cursor on the listadapter.