Я пытаюсь получить строки из базы данных и сделать из нее список.List View Problem
Это методом запроса внутри DbAdapter
public Cursor readInbox(long toId) throws SQLException {
return db.query(TABLE_MAILS, new String[] { ID, KEY_FROM, KEY_TO,
KEY_SUB, KEY_BODY, KEY_DATETIME, KEY_READ }, KEY_TO + "="
+ toId, null, null, null, null, null);
}
Это код, я пытаюсь писать. но дает ошибку
public class InboxActivity extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.inbox);
DBAdapter db = new DBAdapter(InboxActivity.this);
db.open();
long userID = Long.parseLong(MessagingApplication.getUserID());
Cursor inbox = db.readInbox(userID);
startManagingCursor(inbox);
String[] Id = new String[] { DBAdapter.ID };
SimpleCursorAdapter inboxmail = new SimpleCursorAdapter(this, R.layout.list_view, db, Id, null);
setListAdapter(inboxmail);
db.close();
}
}
Ошибка:
The constructor SimpleCursorAdapter(InboxActivity, int, DBAdapter, String[], null) is undefined
какая ошибка это бросает? –
Конструктор SimpleCursorAdapter (InboxActivity, int, DBAdapter, String [], null) не определен –