마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

SimpleCursorAdapter , ListView 에서의 글자 색상 관련질문

+1 추천
이런식으로 DB에 저장된 값을 커서객체로 끌어다가 
어뎁터에 넣고 
리스트뷰로 보여지게 했는데
 
실행시키면 글자가 보이질 않습니다;; 
 
주요 소스코드 입니다. 
 
helper = new DBHelper(this, "data.db", null, 1);
db = helper.getWritableDatabase();
Cursor cursor = db.rawQuery("SELECT _id,name,score FROM data", null);
db.execSQL("INSERT INTO data VALUES(null,'ㅇ','ㅁ')");
 
@SuppressWarnings("deprecation")
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1, cursor, new String[] {
"name", "score" }, new int[] { R.id.textView1,
R.id.textView2 });
ListView list = (ListView) this.findViewById(R.id.list);
list.setAdapter(adapter);
 

 

 

XML 입니다

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/back"
    android:orientation="vertical" >
 
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="선택 항목 : "
        android:textColor="#000000" />
 
    <TextView
        android:id="@+id/selected"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#000000"
        android:text="선택된 것이 없음" />
 
    <ListView
        android:id="@+id/list"
        android:layout_width="fill_parent"
        android:layout_height="370dp"/>
 
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
 
        <Button
            android:id="@+id/Gomain"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:text="메인으로 가기" />
 
    </RelativeLayout>
 
</LinearLayout>
 
 

 

Eve[d] (230 포인트) 님이 2014년 1월 14일 질문
cursor로 데이터가 잘 넘어오나 먼저 확인 해 보세요~

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...