안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요.
DB에서 데이터를 검색 후 검색 내용을 ListView에 보여주고 싶은데..
이때 보여질 때 제가 가지고 있는 폰트를 사용하고 싶습니다.
기본폰트가 아닌경우에는 XML에서 등록이 안되는 것 같아서..
try{
//검색결과가 있는 경우
if( db.search_data(str, list) )
{
listAdapter.notifyDataSetChanged();
mResultList.clearChoices();
for( int i=0 ; i<mResultList.getChildCount() ; i++)
{
((CheckedTextView)mResultList.getChildAt(i)).setTypeface(typef);
}//end for
}//end if
else
{
Toast.makeText(SpellSearch.this, "검색 결과가 없습니다.", Toast.LENGTH_LONG).show();
}//end else
이렇게 코드를 구성했는데요..
이상하게...
((CheckedTextView)mResultList.getChildAt(i)) 값이 NULL이 나옵니다.
분명 DB에서 검색 결과가 있고... ListAdapter에도 데이터가 들어가 있습니다.
왜 그런지 도저히 모르겠네요;;ㅡㅡ;
도와주세요.
DB에서 데이터를 검색 후 검색 내용을 ListView에 보여주고 싶은데..
이때 보여질 때 제가 가지고 있는 폰트를 사용하고 싶습니다.
기본폰트가 아닌경우에는 XML에서 등록이 안되는 것 같아서..
try{
//검색결과가 있는 경우
if( db.search_data(str, list) )
{
listAdapter.notifyDataSetChanged();
mResultList.clearChoices();
for( int i=0 ; i<mResultList.getChildCount() ; i++)
{
((CheckedTextView)mResultList.getChildAt(i)).setTypeface(typef);
}//end for
}//end if
else
{
Toast.makeText(SpellSearch.this, "검색 결과가 없습니다.", Toast.LENGTH_LONG).show();
}//end else
이렇게 코드를 구성했는데요..
이상하게...
((CheckedTextView)mResultList.getChildAt(i)) 값이 NULL이 나옵니다.
분명 DB에서 검색 결과가 있고... ListAdapter에도 데이터가 들어가 있습니다.
왜 그런지 도저히 모르겠네요;;ㅡㅡ;
도와주세요.