this.db = openHelper.getWritableDatabase();
Cursor cursor = this.db.query(constantValues.TABLE_NAME, new String[] { "emailid" },null, null, null, null, null);
if (cursor.moveToFirst()) {
do {
String emailid=cursor.getString(0); // Here you can get data from table and stored in string if it has only one string.
textview.setText(emailid);
} while (cursor.moveToNext());
}
if (cursor != null && !cursor.isClosed()) {
cursor.close();
}
if(db!=null)
{
db.close();
}
}
, если он содержит несколько данных и хранится в нескольких текстовых представлениях.Вы должны сохранить его список, а затем взять данные из списка и установить текстовое представление следующим образом:
List<String> list = new ArrayList<String>();
Cursor cursor = this.db.query(constantValues.TABLE_NAME, new String[] { "emailid"},null, null, null, null, null); // here emailid is the field name in the table and contantValues.TABLE_NAME is the table name
if (cursor.moveToFirst()) {
do {
list.add(cursor.getString(0));
} while (cursor.moveToNext());
}
, затем взять данные из списка и установить текстовое представление.для дальнейшей справки проверьте эту ссылку