delete.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Cursor c= myDB.rawQuery("DELETE FROM contacts where id_ctc='"+t+"'",null);
Intent i = new Intent(Dial.this,TabLayout.class);
startActivity(i);
}
});
应用程序停止工作(不幸的是,Tablayout已停止。)
答案 0 :(得分:1)
public void onClick(View v) {
myDB.delete(TABLE_CONTACTS, id_ctc + " = ?", new String[] { String.valueOf(t) });
Cursor c= myDB.rawQuery("DELETE FROM contacts where id_ctc='"+t+"'",null);
Intent i = new Intent(Dial.this,TabLayout.class);
startActivity(i);
}