0
Is not deleting table referring to database Android Studio points no error when clicking the button the program does nothing
(NA ACTIVITY Databasehelper) public void delete() {
SQLiteDatabase db = getWritableDatabase();
db.execSQL("DROP IF TABLE EXISTS mylist_data");
onCreate(db);
}
(NA ACTIVITY Mainactivity) (On top) public class Mainactivity extends Appcompatactivity {
DatabaseHelper myDB;
Button button, button4, button2, button5;
EditText editText, editText2, editText3, editText4;
(Down at the time to call the metodo)
button2.setOnClickListener(new View.Onclicklistener() { @Override public void onClick(View v) {
myDB.delete();
Did you refer to button2? button2 = findViewById(R.id.button2); I did not see in your code above.
– Giul Rodrigues