我使用以下代碼從數據庫中提取記錄。如何在sqlite中檢索後啓用記錄刪除?
for (LocWiseProfileBeans cn : LocWiseProfile) {
// get a reference for the TableLayout
TableLayout table = (TableLayout) findViewById(R.id.locprofile_table);
// create a new TableRow
TableRow row = new TableRow(this);
// count the counter up by one
counter++;
String log = "Loc Name: "+cn.getLocname()+" ,Lattitude: " + cn.getLattitude()+ " ,Longitude: " + cn.getLongitude()+ " , Selected Profile :"+cn.getSelectedprofile();
TextView t = new TextView(this);
// set the text to "text xx"
t.setText(cn.getLocname());
TextView t2 = new TextView(this);
t2.setText(cn.getSelectedprofile());
row.addView(t);
row.addView(t2);
table.addView(row,new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
但我需要啓用此記錄以刪除用戶請求。
意思是如果用戶點擊第二條記錄,那麼這條記錄將被刪除。
我試圖找到答案,但沒有找到任何合適的答案.......
請給我參考代碼或文章。
先謝謝您!
也許你可以使用ListView來顯示結果? – Hanon 2012-03-09 08:49:41
哪些視圖應該用於啓用記錄?謝謝 – 2012-03-09 08:51:10
@raju:如果用戶點擊任何記錄,那麼它應該被刪除.. – 2012-03-09 09:18:37