我使用以下代码从数据库中提取记录。如何在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