다음 코드를 사용하여 데이터베이스에서 레코드를 가져옵니다.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
보기를 사용하여 레코드를 사용해야합니까? thanks –
@raju : 사용자가 아무 레코드 나 클릭하면 삭제해야합니다 .. –