2011-02-07 5 views

답변

1

버튼을 클릭 청취자 u는 하나의 목록으로 모든 데이터를 가져 오는 코드를 작성한 다음 u를 목록보기로 정렬합니다. inforamtion에있어서의 아래 링크

SQLite in android

을 참조

코드 아래 SQLite는

public List<String> selectAll() { 
      List<String> list = new ArrayList<String>(); 
      Cursor cursor = this.db.query(TABLE_NAME, new String[] { "name" }, 
      null, null, null, null, "name desc"); 
      if (cursor.moveToFirst()) { 
      do { 
       list.add(cursor.getString(0));<wbr> 
      } while (cursor.moveToNext()); 
      } 
      if (cursor != null && !cursor.isClosed()) { 
      cursor.close(); 
      } 
      return list; 
     } 

로부터 데이터를 얻기 위해 사용

관련 문제