2012-10-22 4 views
0

나는 이상한 버그가있다. 이 http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/을 사용하는 다른 listview를 사용하여 제목과 함께 listview를 만들었습니다. 필자는 제목 목록에 직선 배열을 채웠고 (그다지 많지는 않음) 기존 데이터베이스에서 항목 목록 뷰를 채 웁니다. 두 목록보기가 정상적으로 표시되고 관련 항목을 클릭하여 관련 항목을 확인하지만 목록 의 검색 매개 변수 외부 항목이 있습니다. 사전에목록보기에서 sqlite 데이터베이스의 무작위 항목?

private Cursor getBeginnersCursor() 
{ 
    this.cursor = null; 
    try{ 

     this.getmDB(); 
     if(this.mDB == null) 
     { 
      System.out.println("mDB = null"); 
     } 

     this.cursor = mDB.query(TABLE_NAME,new String[]{KEY_ID,GAME_NAME}, "_id > 11 AND _id < 35", 
       null,null,null,null); 
     if(this.cursor != null) 
     { 
      this.cursor.moveToNext(); 
     } 
     mDB.close(); 
     return this.cursor; 
    }catch(SQLException e){ 
     throw e; 
    } 
} 



private List<String> getBeginnersArrayList() 
{ 
    this.getmDB(); 

    this.cursor = this.getBeginnersCursor(); 

    String result; 

    for(this.cursor.moveToFirst(); !this.cursor.isAfterLast();this.cursor.moveToNext()) 
    { 
     result = this.cursor.getString(1) + "\n"; 
     this.beginnersArrayList.add(result); 
    } 
    this.cursor.close(); 
    return beginnersArrayList; 
} 

많은 감사 :

이 목록을 반환하는 클래스입니다.

답변

0

좋아요. 알아 냈습니다. SQLite doesnt는 Integer 값과 같은 텍스트 정수 값을 처리하는 것처럼 보이므로 id의 9와 10 사이에 id 1을 섞어 쓰고있었습니다. 필자는 섹션을 정의하기 위해 다른 컬럼을 만들었습니다.

관련 문제