public class BookmarkListActivity extends Activity implements OnClickListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.query);
LinearLayout layout = (LinearLayout) findViewById(R.id.sites);
try {
// DBManager 객체 생성(DB 존재 않으면 생성)
DBManager dbmgr = new DBManager(this);
// DB 연결
SQLiteDatabase sdb = dbmgr.getReadableDatabase();
// SQL문 실행 결과를 cursor 객체로 받음
Cursor cursor = sdb.rawQuery("select wid, wname, waddress, remark, hits from websites", null);
int i = 0;
while (cursor.moveToNext()) {
String wid = cursor.getString(0);
String wname = cursor.getString(1);
String waddress = cursor.getString(2);
String remark = cursor.getString(3);
String hits = cursor.getString(4);
TextView tv_list = new TextView(this);
tv_list.append(wid);
tv_list.append(wname);
tv_list.append(waddress);
tv_list.append(remark);
tv_list.append(hits);
layout.addView(tv_list);
tv_list.setId(i);
tv_list.setOnClickListener(this);
tv_list.setTag(wid);
i++;
}
if (i == 0) {
TextView tv_desc = new TextView(this);
tv_desc.append("등록된 사이트가 없습니다!");
layout.addView(tv_desc);
}
cursor.close();
dbmgr.close();
} catch (SQLiteException e) {
TextView tv_err = new TextView(this);
// tv_desc.append("등록된 사이트가 없습니다!");
tv_err.append(e.getMessage());
layout.addView(tv_err);
}
}
// 사이트이름이 클릭되었을 때
public void onClick(View v) {
Intent it = new Intent();
// 현재 클래스에서 호출할 클래스 지정
it = new Intent(this, BookmarkDetailActivity.class);
// 입력한 값을 저장
it.putExtra("it_name", (String) v.getTag());
String str_name = it.getStringExtra("it_name");
try{
//DB객체 생성
DBManager dbmgr = new DBManager(this);
SQLiteDatabase sdb = dbmgr.getReadableDatabase();
//클릭수 증가
sdb.execSQL("update websites set hits=hits+1 where wid='"+ str_name + "' ");
//객체 닫음
dbmgr.close();
}catch(SQLiteException e){
//DB접속 또는 조회 시 에러 발생 할 때(생략)
}
// 인텐트에서 지정한 액티비티 실행
startActivity(it);
// 현재 액티비티 종료
finish();
}
}

사진에서 '번호 이름 주소 설명 클릭수' 는 레이아웃에서 텍스트뷰로 weight = 1씩 해서 정렬했는데요.
그아래 사이트 정보는 SQLite에서 가져와서 리니어레이아웃에 그냥 뿌리는 방식으로 되어있어서 정렬이안되어있는데
번호 이름 주소 설명 클릭수
1 네이.. http:/.... 대한.... 22
2 구글 http:/.... Bes.... 10
이런식으로 정렬해서 넘어가는부분은 ...으로 표시되게 하고싶은데, 방법이 없을까요??
안드로이드 초짜입니다. 죄송합니다만 설명은 너무 어렵지 않게 부탁드리겠습니다! ㅠ