Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import android.database.Cursor; public class Main { public static ArrayList<String> cursorToArrayList(Cursor cursor) { ArrayList<String> list = new ArrayList<String>(); cursor.moveToFirst(); while (cursor.isAfterLast() == false) { list.add(cursor.getString(cursor.getColumnIndex("name"))); cursor.moveToNext(); } return list; } }