Being new in Android, I am having trouble dealing with the following:
public String[] getContacts(){
Cursor cursor = getReadableDatabase().rawQuery(\"SELECT
Try to put the data into the ArrayList
as below:
public ArrayList
getContacts(){ Cursor cursor = getReadableDatabase().rawQuery("SELECT name FROM contacts", null); ArrayList names=new ArrayList (); if (cursor != null) { if (cursor.moveToFirst()) { for(int i = 0; i < cursor.getCount(); i ++){ names.add(cursor.getString(i)); } } cursor.close(); } return names; }