안드로이드 개발 질문/답변
(글 수 45,052)
아래 질문에 또 다른 상황이 발생해서 질문드립니다.
Cursor에 담긴만큰
SimpleCursorAdapter 로 뭔가가 가져오긴 한것 같은데
Spinner에 뿌릴때 DATA값이 아무것도 없는 걸로 계속 출력되어지고 있습니다.
이건 뭐가 문제인가여
SpinnerAdapter adapter=new SimpleCursorAdapter( this
,android.R.layout.simple_spinner_item
,cursor
,new String[] {ProviderSampler.Constants.TSA_MCL_NM}
,new int[] {R.id.customer });
이전소스 에서 _id값때문에 하나더 추가를 해봤습니다.
SpinnerAdapter adapter=new SimpleCursorAdapter( this
,android.R.layout.simple_spinner_item
,cursor
,new String[] {ProviderSampler.Constants._ID,ProviderSampler.Constants.TSA_MCL_NM}
,new int[] {R.id.spinner_id ,R.id.customer });
이틀 동안 코피 터지는군여..
Cursor에 담긴만큰
SimpleCursorAdapter 로 뭔가가 가져오긴 한것 같은데
Spinner에 뿌릴때 DATA값이 아무것도 없는 걸로 계속 출력되어지고 있습니다.
이건 뭐가 문제인가여
SpinnerAdapter adapter=new SimpleCursorAdapter( this
,android.R.layout.simple_spinner_item
,cursor
,new String[] {ProviderSampler.Constants.TSA_MCL_NM}
,new int[] {R.id.customer });
이전소스 에서 _id값때문에 하나더 추가를 해봤습니다.
SpinnerAdapter adapter=new SimpleCursorAdapter( this
,android.R.layout.simple_spinner_item
,cursor
,new String[] {ProviderSampler.Constants._ID,ProviderSampler.Constants.TSA_MCL_NM}
,new int[] {R.id.spinner_id ,R.id.customer });
이틀 동안 코피 터지는군여..
wordCur = dbAdt.fetchAllWords();
String[] from = new String[]{DBAdaptor.WORD_KEY_COLUMN1, DBAdaptor.WORD_KEY_COLUMN2,
DBAdaptor.WORD_KEY_COLUMN3};
int[] to = new int[]{R.id.row_spelling, R.id.row_wordclass, R.id.row_meaning};
SimpleCursorAdapter cursorAdatper = new SimpleCursorAdapter(this, R.layout.row, wordCur, from, to);
listView.setAdapter(cursorAdatper);
이렇게 사용을 하고 있는데요, SimpleCursorAdapter cursorAdatper = new SimpleCursorAdapter(this, R.layout.row, wordCur, from, to);
부분에서 2번째 인자인 R.layout.row 와 4번째 5번째 인자인 from, to의 구조가 맞아 떨어져야 합니다. 그런데 님같은경우는 2번째 인자를 안드로이드 내부 레이아웃인 android.R.layout.simple_spinner_item 를 쓰셨는데 이것이 구조가 님이 4번째 5번째로 준 인자와 구조가 안맞는 듯 합니다. 레이아웃을 님이 생각한 구조에 맞게 간단하게 만들어서 해보세요.