How to return a list in a column e.g like all emails in column…here my code
public String reTurn() throws SQLException
{
String emails=null;
Cursor mCursor = db.rawQuery("SELECT EmailNO FROM Details_Customer " ,null);
mCursor.moveToFirst();
if(mCursor.getCount() > 0){
emails= mCursor.getString(mCursor.getColumnIndex(DBAdapter.COLUMN_EMAIL));
//password = mCursor.getString(11);
}
return emails;
}
But it only returning one email, I want it to return all the emails in a database
Try this:
Added from comment
From this:
I guess that your are trying to put the array of email addresses into an Intent called
email. Here is a better approach:And to put this in an Intent:
Lastly, in your new Activity read the email array with:
Hope that helps.