안드로이드 개발 질문/답변
(글 수 45,052)
Cursor cursor = null;
cursor = mDatabase.query(TABLE_NAME, columns, null, null, null, null, null);
String[] from= new String[]{COLUMN_ID,COLUMN_NAME,COLUMN_START, COLUMN_TIME ,COLUMN_SPACE};
int[] to = new int[] {R.id.text01,R.id.text02, R.id.text03, R.id.text05, R.id.text04};
SimpleCursorAdapter ad = new SimpleCursorAdapter(this,
R.layout.linerow,
cursor,
from,
to
);
setListAdapter(ad);
이렇게 작성하여 눌러서 메인화면을 출력하였습니다.
그런데
여기서
쿼리를 작성하여 버튼을 누르시
새롭게 리스트를 출력 시키려고 하는데
소스를 복사하여
Cursor cursor = null;
String select = "SELECT * FROM numbers WHERE Name = '아무개' ";
cursor = mDatabase.rawQuery(select, null);
String[] from= new String[]{COLUMN_ID,COLUMN_NAME,COLUMN_START, COLUMN_TIME ,COLUMN_SPACE};
int[] to = new int[] {R.id.text01,R.id.text02, R.id.text03, R.id.text05, R.id.text04};
SimpleCursorAdapter aad = new SimpleCursorAdapter(this,
R.layout.linerow,
cursor,
from,
to
);
setListAdapter(aad);
했는데 어플을 실행후 버튼을 누르니까
오류가 생기네요...
어떻게 해야 할까요..
그리고
String select = "SELECT * FROM numbers WHERE Name = '아무개' ";
여기서.. 아무개로 검색하면
아무개로 된 값이 출력되는데.
아무로 검색하면 출력 되지 않습니다.
원래 그런것인가요?
아니면 제가 잘못해서 그런것인지..
cursor = mDatabase.query(TABLE_NAME, columns, null, null, null, null, null);
String[] from= new String[]{COLUMN_ID,COLUMN_NAME,COLUMN_START, COLUMN_TIME ,COLUMN_SPACE};
int[] to = new int[] {R.id.text01,R.id.text02, R.id.text03, R.id.text05, R.id.text04};
SimpleCursorAdapter ad = new SimpleCursorAdapter(this,
R.layout.linerow,
cursor,
from,
to
);
setListAdapter(ad);
이렇게 작성하여 눌러서 메인화면을 출력하였습니다.
그런데
여기서
쿼리를 작성하여 버튼을 누르시
새롭게 리스트를 출력 시키려고 하는데
소스를 복사하여
Cursor cursor = null;
String select = "SELECT * FROM numbers WHERE Name = '아무개' ";
cursor = mDatabase.rawQuery(select, null);
String[] from= new String[]{COLUMN_ID,COLUMN_NAME,COLUMN_START, COLUMN_TIME ,COLUMN_SPACE};
int[] to = new int[] {R.id.text01,R.id.text02, R.id.text03, R.id.text05, R.id.text04};
SimpleCursorAdapter aad = new SimpleCursorAdapter(this,
R.layout.linerow,
cursor,
from,
to
);
setListAdapter(aad);
했는데 어플을 실행후 버튼을 누르니까
오류가 생기네요...
어떻게 해야 할까요..
그리고
String select = "SELECT * FROM numbers WHERE Name = '아무개' ";
여기서.. 아무개로 검색하면
아무개로 된 값이 출력되는데.
아무로 검색하면 출력 되지 않습니다.
원래 그런것인가요?
아니면 제가 잘못해서 그런것인지..