mysql php android。 从表中删除了所有行,但最后一行仍显示在listview上

my android app inserts and shows queries from mysql database fine. Yet only problem is when i deleted every row from a table, the last row deleted still shows up on the android application. Only the last one left will show up. If there was 5 rows and i deleted one, 4 rows will show (working properly). But when i keep deleting till there is only one row left even if i delete it over and over again it still shows up. On phpmyadmin the table is empty yet my app is still showing there is one result left. When i close the app and open again that row is gone.

I tried figuring this out. I felt it was something to do with the last row being kept in android memory, 1)I tried system.gc(); in android. 2) session_destroy(); in php. nothing.

Its not a big problem because there should never be a time when this table is completely empty yet it is bothering me.
Thanks in advance

deletion code query="Delete from table where id ="+id; Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection(url, user, pass); Statement st = con.createStatement(); st.executeUpdate(query);

  1. You can remove all data from a listArray for ListView.

    listArray.clear();
    
  2. When you delete a row, check what exactly you are deleting (it has maybe position issue)

  3. Check whether you are using another table or not

  4. You did,

    listview.setAdapter(yourAdapter);
    

    then, call below after delete last row.

    yourAdapter.notifyDatasetChanged();