I’ve created a SQLite Android dB in my app. I can add info to the dB without any problem. But I’m not able to delete anything from it.
This is my code:
final SQLManager hon = new SQLManager(this);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
long l = 3;
hon.open();
hon.deleteEntry(l);
hon.close();
}
});
And here is the method “deleteEntry()”:
public void deleteEntry(long l) {
// TODO Auto-generated method stub
ourDatabase.delete(DATABASE_TABLE, null, null);
}
It was supposed to delete the whole dB, wasn’t it? The button which makes the delete function when pressed is in the same view than the dB, is this a problem?
you can use the following code